/** Cooked with Flambe, https://getflambe.com */
'use strict';
(function () {
    function v(a, b) {
        function c() {}
        c.prototype = a;
        var d = new c,
            h;
        for (h in b) d[h] = b[h];
        b.toString !== Object.prototype.toString && (d.toString = b.toString);
        return d
    }

    function Zb(a) {
        return a instanceof Array ? function () {
            return s.iter(a)
        } : "function" == typeof a.iterator ? fa(a, a.iterator) : a.iterator
    }

    function fa(a, b) {
        if (null == b) return null;
        null == b.__id__ && (b.__id__ = kc++);
        var c;
        null == a.hx__closures__ ? a.hx__closures__ = {} : c = a.hx__closures__[b.__id__];
        null == c && (c = function () {
            return c.method.apply(c.scope,
                arguments)
        }, c.scope = a, c.method = b, a.hx__closures__[b.__id__] = c);
        return c
    }
    var f = {}, q = function () {
            return D.__string_rec(this, "")
        }, X = function (a, b) {
            b = b.split("u").join("");
            this.r = RegExp(a, b)
        };
    f.EReg = X;
    X.__name__ = ["EReg"];
    X.prototype = {
        match: function (a) {
            this.r.global && (this.r.lastIndex = 0);
            this.r.m = this.r.exec(a);
            this.r.s = a;
            return null != this.r.m
        },
        matched: function (a) {
            if (null != this.r.m && 0 <= a && a < this.r.m.length) return this.r.m[a];
            throw "EReg::matched";
        },
        matchedPos: function () {
            if (null == this.r.m) throw "No string matched";
            return {
                pos: this.r.m.index,
                len: this.r.m[0].length
            }
        },
        split: function (a) {
            return a.replace(this.r, "#__delim__#").split("#__delim__#")
        },
        __class__: X
    };
    var Y = function () {};
    f.G = Y;
    Y.__name__ = ["G"];
    Y.saveHiScore = function (a) {
        a > Y.HI_SCORE && (Y.HI_SCORE = a, e.saveData("hi_score", Y.HI_SCORE))
    };
    Y.loadHiScore = function () {
        var a = e.loadData("hi_score");
        Y.HI_SCORE = 0 < a ? a : 0
    };
    var la = function (a, b) {
        null == b && (b = 0);
        null == a && (a = 0);
        this.x = a;
        this.y = b
    };
    f["flambe.math.Point"] = la;
    la.__name__ = ["flambe", "math", "Point"];
    la.prototype = {
        __class__: la
    };
    var i = function (a, b, c) {
        i.ref = this;
        this.rootRef = a;
        this.width = b;
        this.height = c;
        i.offsetX = (e.width - b * (i.pieceWidth + i.gap)) / 2 + i.pieceWidth / 2 | 0;
        a = [];
        b = 0;
        for (c = this.height; b < c;) b++, a.push(function (a) {
            for (var b = [], c = 0, a = a.width; c < a;) c++, b.push(null);
            return b
        }(this));
        this.grid = a;
        x.canMakeAction = !0
    };
    f.Grid = i;
    i.__name__ = ["Grid"];
    i.prototype = {
        addRandPiece: function (a, b) {
            return new x(a, b, y.random(i.pieceTypes))
        },
        addBonusPieceAt: function (a, b) {
            var c = new x(b, 0, i.pieceTypes + a);
            return this.grid[0][b] = c
        },
        addRandRows: function (a) {
            for (var b =
                this.grid.length - 1, a = b - a; b > a;) {
                for (var c = 0, d = this.grid[b].length; c < d;) {
                    var h = c++;
                    this.grid[b][h] = this.addRandPiece(h, b)
                }
                b--
            }
        },
        getPiecesOfType: function (a) {
            for (var b = [], c = 0, d = this.grid.length; c < d;)
                for (var h = c++, j = 0, e = this.grid[h].length; j < e;) {
                    var f = j++;
                    null != this.grid[h][f] && this.grid[h][f].type == a && b.push(this.grid[h][f])
                }
            return b
        },
        pushPiecesUp: function () {
            var a = this.getPiecesAtTop();
            if (0 < a.length)
                for (var b = 0, c = a.length; b < c;) {
                    var d = b++;
                    if (!(a[d].type > i.pieceTypes - 1)) return !1
                }
            a = 0;
            for (b = this.grid.length; a <
                b;)
                for (var c = a++, d = 0, h = this.grid[c].length; d < h;) {
                    var j = d++;
                    null != this.grid[c][j] && (0 != c ? (this.grid[c - 1][j] = this.grid[c][j], this.grid[c - 1][j].gridY = c - 1, this.grid[c - 1][j].tweenOnPushUp(), this.grid[c][j] = null) : this.grid[c][j].type > i.pieceTypes - 1 && (this.grid[c][j].tweenOnBonusDeath(), this.grid[c][j] = null))
                }
            this.getPiecesAtTop();
            return !0
        },
        getPiecesAtTop: function () {
            for (var a = [], b = 0, c = this.grid[0].length; b < c;) {
                var d = b++;
                null != this.grid[0][d] && (a.push(this.grid[0][d]), this.grid[0][d].tweenOnTop())
            }
            return a
        },
        coordsInGrid: function (a, b) {
            return 0 <= a && 0 <= b && a < this.width && b < this.height
        },
        getPiece: function (a, b) {
            return this.coordsInGrid(a, b) && null != this.grid[b][a] ? this.grid[b][a] : null
        },
        neighbourOf: function (a, b) {
            var c = a.relativeCoordinates(b, 1);
            return this.getPiece(c.x | 0, c.y | 0)
        },
        neighboursOf: function (a) {
            for (var b = [], c = 0, d = i.dirs.length; c < d;) {
                var h = c++;
                b.push(this.neighbourOf(a, i.dirs[h]))
            }
            return b
        },
        getDeepMatches: function (a) {
            null == a && (a = 2);
            for (var b = [], c = [], d = 0, h = this.grid.length; d < h;)
                for (var j = this.grid[d++],
                        e = 0, f = j.length; e < f;) {
                    var k = e++,
                        g = j[k];
                    if (null != g && -1 == ma.indexOf(b, g)) {
                        for (var k = g.deepMatchingNeighbours(), i = 0, l = k.length; i < l;) {
                            var m = i++;
                            b.push(k[m])
                        }
                        if (k.length >= a && null != g) {
                            g = 0;
                            for (i = k.length; g < i;) l = g++, c.push(k[l])
                        }
                    }
                }
            return c
        },
        applyGravityDown: function () {
            for (var a = this.grid.length - 1, b = []; 0 < a;) {
                for (var c = this.grid[a], d = 0, h = c.length; d < h;) {
                    var j = d++;
                    if (null == c[j])
                        for (var e = a; 0 < e;) e--, null != this.grid[e][j] && (this.grid[a][j] = this.grid[e][j], this.grid[a][j].gridY = a, b.push(this.grid[a][j]), this.grid[e][j] =
                            null, e = 0)
                }
                a--
            }
            return b
        },
        slideToLeft: function () {
            for (var a = this.grid[this.grid.length - 1], b = 0, c = [], d = 0, h = a.length; d < h;) {
                var j = d++;
                if (null == a[j] && j != a.length - 1 && (b++, null != a[j + 1])) {
                    for (var j = j + 1, e = a[j]; null != e;) {
                        for (var e = 0, f = this.grid.length; e < f;) {
                            var k = e++;
                            null != this.grid[k][j] && (this.grid[k][j - b] = this.grid[k][j], this.grid[k][j - b].gridX = j - b, c.push(this.grid[k][j - b]), this.grid[k][j] = null)
                        }
                        j++;
                        e = a[j]
                    }
                    b = 0
                }
            }
            return c
        },
        clear: function () {
            for (var a = 0, b = this.grid.length; a < b;)
                for (var c = a++, d = 0, h = this.grid[c].length; d <
                    h;) {
                    var j = d++;
                    null != this.grid[c][j] && this.grid[c][j].tweenOnGameOver();
                    this.grid[c][j] = null
                }
        },
        clear2: function () {
            for (var a = 0, b = this.grid.length; a < b;)
                for (var c = a++, d = 0, h = this.grid[c].length; d < h;) {
                    var j = d++;
                    null != this.grid[c][j] && this.grid[c][j].tweenOnLevelEnd();
                    this.grid[c][j] = null
                }
        },
        __class__: i
    };
    var x = function (a, b, c) {
        this.gridX = a;
        this.gridY = b;
        this.type = c;
        this.init()
    };
    f.Piece = x;
    x.__name__ = ["Piece"];
    x.prototype = {
        init: function () {
            var a = this;
            x.canMakeAction = !0;
            this.pieceEnt = e.addImageSprite(i.ref.rootRef,
                this.getX(), this.initY(), "bl" + this.type);
            this.pieceEnt.add(new ga);
            this.pieceEnt._compMap.Disposer_2.connect1(this.pieceEnt._compMap.Sprite_0.get_pointerUp(), fa(this, this.onPointerUp));
            null == x.actionSequence && (x.actionSequence = new ha, x.actionSequence.add(new Q(function () {
                x.canMakeAction = !1;
                for (var a = i.ref.applyGravityDown(), c = 0, d = a.length; c < d;) {
                    var h = c++;
                    a[h].tweenOnGravityDown()
                }
            })), x.actionSequence.add(new $(0.1)), x.actionSequence.add(new Q(function () {
                for (var b = i.ref.slideToLeft(), c = 0, d = b.length; c <
                    d;) {
                    var h = c++;
                    b[h].tweenOnSlideLeft()
                }
                a.showBonusInfo()
            })), x.actionSequence.add(new Q(function () {
                i.ref.rootRef._compMap.GameSceneComp_7.checkForMatches()
            })), x.actionSequence.add(new Q(function () {
                x.canMakeAction = !0
            })));
            this.tweenOnInit();
            this.showBonusInfo()
        },
        onPointerUp: function () {
            if (x.canMakeAction)
                if (this.type > i.pieceTypes - 1) this.activateBonus3(this.type - i.pieceTypes);
                else {
                    var a = this.deepMatchingNeighbours();
                    if (0 < a.length) {
                        o.playSfx("pop_sfx");
                        for (var b = 0, c = a.length; b < c;) {
                            var d = b++;
                            this.tweenOnRemove(a[d])
                        }
                        this.updateGrid(a);
                        a.length > i.minMatchForBonus - 1 && this.addBonus(e.rand(i.pieceTypes))
                    } else this.tweenShake()
                }
        },
        updateGrid: function (a, b) {
            null == b && (b = !1);
            var c = a.length,
                d = 10 * c * c * c - 10 * c;
            b && (d = 10 * c * c);
            i.ref.rootRef._compMap.GameSceneComp_7.updateScore(d);
            var h;
            h = e.addLabel(i.ref.rootRef, this.getX(), this.getY(), "+" + d, 1, 1, !0)._compMap.Sprite_0;
            S.to(h, 0.5, {
                y: h.y._value - 45
            }, 0, function () {
                h.dispose()
            }, m.cubeOut);
            i.ref.rootRef._compMap.Script_3.run(x.actionSequence)
        },
        addBonus: function (a) {
            var b = this;
            i.ref.rootRef._compMap.Script_3.run(new ha([new $(0.1),
                new Q(function () {
                    i.ref.addBonusPieceAt(a, b.gridX);
                    i.ref.rootRef._compMap.Script_3.run(x.actionSequence)
                })
            ]))
        },
        activateBonus3: function (a) {
            a = i.ref.getPiecesOfType(a);
            if (0 == a.length) this.tweenShake();
            else {
                for (var b = 0, c = a.length; b < c;) {
                    var d = b++;
                    this.tweenOnRemove(a[d])
                }
                this.tweenOnRemove(this);
                o.playSfx("bonus_sfx", 0.6);
                i.ref.rootRef._compMap.Script_3.run(new Ha(10, 0, 0.5));
                this.updateGrid(a, !0)
            }
        },
        showBonusInfo: function () {
            for (var a = [], b = [], c = 0, d = i.ref.grid.length; c < d;)
                for (var h = c++, j = 0, f = i.ref.grid[h].length; j <
                    f;) {
                    var J = j++;
                    if (null != i.ref.grid[h][J]) {
                        i.ref.grid[h][J].pieceEnt.disposeChildren();
                        var k = i.ref.grid[h][J].deepMatchingNeighbours();
                        if (k.length > i.minMatchForBonus - 1 && -1 == ma.indexOf(a, i.ref.grid[h][J])) {
                            b.push(i.ref.grid[h][J]);
                            for (var J = 0, g = k.length; J < g;) {
                                var l = J++;
                                a.push(k[l])
                            }
                        }
                    }
                }
            a = 0;
            for (c = b.length; a < c;) d = a++, e.addImageSprite(b[d].pieceEnt, i.pieceWidth / 2 | 0, i.pieceHeight / 2 | 0, "bonus_marker")
        },
        getX: function () {
            return this.gridX * (i.pieceWidth + i.gap) + (i.gap / 2 | 0) + i.offsetX
        },
        getY: function () {
            return this.gridY *
                (i.pieceHeight + i.gap) + (i.gap / 2 | 0) + i.offsetY
        },
        initY: function () {
            return this.type < i.pieceTypes ? this.getY() + e.height + (i.pieceHeight / 2 | 0) - i.offsetY : -100
        },
        tweenOnInit: function () {
            this.pieceEnt._compMap.Sprite_0.y.animateTo(this.getY(), 0.4, m.bounceIn)
        },
        tweenOnRemove: function (a) {
            this.removeJitterBehavior();
            i.ref.grid[a.gridY][a.gridX] = null;
            a.pieceEnt._compMap.Sprite_0.setAlpha(0.7);
            S.to(a.pieceEnt._compMap.Sprite_0, 0.4, {
                alpha: 0.5,
                scaleX: 0,
                scaleY: 0
            }, 0, function () {
                a.pieceEnt.dispose()
            }, m.backIn)
        },
        tweenOnBonusDeath: function () {
            var a =
                this;
            this.removeJitterBehavior();
            this.pieceEnt._compMap.Sprite_0.setAlpha(0.7);
            this.pieceEnt._compMap.Sprite_0.y.animateTo(e.height + 100, 1, m.backIn);
            S.to(this.pieceEnt._compMap.Sprite_0, 3, {
                rotation: 720
            }, 0, function () {
                a.pieceEnt.dispose()
            }, m.backIn)
        },
        tweenOnLevelEnd: function () {
            x.canMakeAction = !1
        },
        tweenOnGameOver: function () {
            var a = this;
            this.removeJitterBehavior();
            x.canMakeAction = !1;
            S.to(this.pieceEnt._compMap.Sprite_0, 0.4, {
                y: this.getY() - 20
            }, 0, function () {
                a.pieceEnt._compMap.Sprite_0.y.animateTo(e.height +
                    100, 1, m.backIn);
                a.pieceEnt._compMap.Sprite_0.rotation.animateTo(720 * e.randSign(), 3, m.quadIn)
            }, m.backIn)
        },
        tweenOnTop: function () {
            var a = this;
            this.type > i.pieceTypes - 1 || this.pieceEnt._compMap.Script_3.run(new ha([new $(0.6), new Q(function () {
                a.pieceEnt._compMap.Sprite_0.x.set_behavior(new ra(a.getX(), 2));
                a.pieceEnt._compMap.Sprite_0.y.set_behavior(new ra(a.getY(), 2));
                if (null == i.ref.rootRef.firstChild.firstChild) {
                    var b;
                    b = e.addFillSprite(i.ref.rootRef.firstChild, 0, 0, 16711680, e.width, e.height, 0.2, !1)._compMap.Sprite_0;
                    e.addDelay(b.owner, 0.2, function () {
                        0.2 == b.alpha._value ? b.alpha.set__(0) : b.alpha.set__(0.2)
                    }, !0)
                }
            })]))
        },
        removeJitterBehavior: function () {
            this.pieceEnt._compMap.Script_3.stopAll();
            this.pieceEnt._compMap.Sprite_0.x.set_behavior(null);
            this.pieceEnt._compMap.Sprite_0.y.set_behavior(null);
            0 == i.ref.getPiecesAtTop().length && null != i.ref.rootRef.firstChild.firstChild && i.ref.rootRef.firstChild.disposeChildren()
        },
        tweenOnSlideLeft: function () {
            var a = this;
            x.canMakeAction = !1;
            this.pieceEnt._compMap.Sprite_0.x.animateTo(this.getX(),
                0.4, m.backInOut);
            S.to(this.pieceEnt._compMap.Sprite_0, 0.1, {
                rotation: 10,
                scaleX: 0.7
            }, 0.1, function () {
                S.to(a.pieceEnt._compMap.Sprite_0, 0.15, {
                    rotation: 0,
                    scaleX: 1
                }, 0, null, m.backOut)
            }, m.backIn)
        },
        tweenOnPushUp: function () {
            x.canMakeAction = !1;
            S.to(this.pieceEnt._compMap.Sprite_0, 0.4, {
                y: this.getY()
            }, 0, function () {
                x.canMakeAction = !0
            }, m.backIn)
        },
        tweenOnGravityDown: function () {
            var a = this;
            this.removeJitterBehavior();
            this.pieceEnt._compMap.Sprite_0.y.animateTo(this.getY(), 0.4, m.backIn);
            S.to(this.pieceEnt._compMap.Sprite_0,
                0.15, {
                    scaleX: 1.2,
                    scaleY: 0.7
                }, 0.1, function () {
                    S.to(a.pieceEnt._compMap.Sprite_0, 0.25, {
                        scaleX: 1,
                        scaleY: 1
                    }, 0, null, m.backInOut)
                }, m.bounceInOut)
        },
        tweenShake: function () {
            o.playSfx("no_match_sfx", 0.5);
            this.pieceEnt._compMap.Sprite_0.x.set__(this.getX());
            this.pieceEnt._compMap.Sprite_0.y.set__(this.getY());
            this.pieceEnt._compMap.Script_3.run(new Ha(10, 0, 0.3))
        },
        relativeCoordinates: function (a, b) {
            return new la(this.gridX + b * a.x, this.gridY + b * a.y)
        },
        neighbours: function () {
            return i.ref.neighboursOf(this)
        },
        matchingNeighbours: function () {
            for (var a = [], b = this.neighbours(), c, d = 0, h = b.length; d < h;) c = d++, c = b[c], null != c && c.type == this.type && this.type < i.pieceTypes && a.push(c);
            return a
        },
        deepMatchingNeighbours: function () {
            var a = [],
                b = null,
                b = function (c) {
                    for (var c = c.matchingNeighbours(), d = 0, h = c.length; d < h;) {
                        var j = d++,
                            j = c[j]; - 1 == ma.indexOf(a, j) && (a.push(j), b(j))
                    }
                };
            b(this);
            return a
        },
        __class__: x
    };
    var s = function () {};
    f.HxOverrides = s;
    s.__name__ = ["HxOverrides"];
    s.dateStr = function (a) {
        var b = a.getMonth() + 1,
            c = a.getDate(),
            d = a.getHours(),
            h = a.getMinutes(),
            j = a.getSeconds();
        return a.getFullYear() + "-" + (10 > b ? "0" + b : "" + b) + "-" + (10 > c ? "0" + c : "" + c) + " " + (10 > d ? "0" + d : "" + d) + ":" + (10 > h ? "0" + h : "" + h) + ":" + (10 > j ? "0" + j : "" + j)
    };
    s.strDate = function (a) {
        switch (a.length) {
        case 8:
            var a = a.split(":"),
                b = new Date;
            b.setTime(0);
            b.setUTCHours(a[0]);
            b.setUTCMinutes(a[1]);
            b.setUTCSeconds(a[2]);
            return b;
        case 10:
            return a = a.split("-"), new Date(a[0], a[1] - 1, a[2], 0, 0, 0);
        case 19:
            return b = a.split(" "), a = b[0].split("-"), b = b[1].split(":"), new Date(a[0], a[1] - 1, a[2], b[0], b[1], b[2]);
        default:
            throw "Invalid date format : " +
                a;
        }
    };
    s.cca = function (a, b) {
        var c = a.charCodeAt(b);
        return c != c ? void 0 : c
    };
    s.substr = function (a, b, c) {
        if (null != b && 0 != b && null != c && 0 > c) return "";
        null == c && (c = a.length);
        0 > b ? (b = a.length + b, 0 > b && (b = 0)) : 0 > c && (c = a.length + c - b);
        return a.substr(b, c)
    };
    s.remove = function (a, b) {
        var c = a.indexOf(b);
        if (-1 == c) return !1;
        a.splice(c, 1);
        return !0
    };
    s.iter = function (a) {
        return {
            cur: 0,
            arr: a,
            hasNext: function () {
                return this.cur < this.arr.length
            },
            next: function () {
                return this.arr[this.cur++]
            }
        }
    };
    var ma = function () {};
    f.Lambda = ma;
    ma.__name__ = ["Lambda"];
    ma.array = function (a) {
        for (var b = [], a = Zb(a)(); a.hasNext();) {
            var c = a.next();
            b.push(c)
        }
        return b
    };
    ma.count = function (a, b) {
        var c = 0;
        if (null == b)
            for (var d = Zb(a)(); d.hasNext();) d.next(), c++;
        else
            for (d = Zb(a)(); d.hasNext();) {
                var h = d.next();
                b(h) && c++
            }
        return c
    };
    ma.indexOf = function (a, b) {
        for (var c = 0, d = Zb(a)(); d.hasNext();) {
            var h = d.next();
            if (b == h) return c;
            c++
        }
        return -1
    };
    var Va = function () {
        this.length = 0
    };
    f.List = Va;
    Va.__name__ = ["List"];
    Va.prototype = {
        add: function (a) {
            a = [a];
            null == this.h ? this.h = a : this.q[1] = a;
            this.q = a;
            this.length++
        },
        iterator: function () {
            return {
                h: this.h,
                hasNext: function () {
                    return null != this.h
                },
                next: function () {
                    if (null == this.h) return null;
                    var a = this.h[0];
                    this.h = this.h[1];
                    return a
                }
            }
        },
        __class__: Va
    };
    var sa = function () {};
    f.Main = sa;
    sa.__name__ = ["Main"];
    sa.main = function () {
        l.init();
        e.systemBgColor = 5459013;
        (new e(640, 960)).init.connect(sa.onInit).once()
    };
    sa.onInit = function () {
        sa.lang = SG.lang; //SG_Hooks.getLanguage("en,de,es,fr,it,pt,ru,tk".split(","));
        SG_Hooks.setResizeHandler(e.onResizeCallback);
        SG_Hooks.setOrientationHandler(e.onOrientationChangeCallback);
        Y.loadHiScore();
        e.buttonClickSfx = "button_click_sfx";
        e.goToScene((new Ia).root)
    };
    var Db = function () {};
    f.IMap = Db;
    Db.__name__ = ["IMap"];
    Math.__name__ = ["Math"];
    var z = function () {};
    f.Reflect = z;
    z.__name__ = ["Reflect"];
    z.field = function (a, b) {
        try {
            return a[b]
        } catch (c) {
            return null
        }
    };
    z.getProperty = function (a, b) {
        var c;
        return null == a ? null : a.__properties__ && (c = a.__properties__["get_" + b]) ? a[c]() : a[b]
    };
    z.callMethod = function (a, b, c) {
        return b.apply(a, c)
    };
    z.fields = function (a) {
        var b = [];
        if (null != a) {
            var c = Object.prototype.hasOwnProperty,
                d;
            for (d in a) "__id__" != d && "hx__closures__" != d && c.call(a, d) && b.push(d)
        }
        return b
    };
    z.isFunction = function (a) {
        return "function" == typeof a && !(a.__name__ || a.__ename__)
    };
    z.deleteField = function (a, b) {
        if (!Object.prototype.hasOwnProperty.call(a, b)) return !1;
        delete a[b];
        return !0
    };
    var y = function () {};
    f.Std = y;
    y.__name__ = ["Std"];
    y.is = function (a, b) {
        return D.__instanceof(a, b)
    };
    y.string = function (a) {
        return D.__string_rec(a, "")
    };
    y["int"] = function (a) {
        return a | 0
    };
    y.parseInt = function (a) {
        var b = parseInt(a, 10);
        if (0 == b && (120 ==
            s.cca(a, 1) || 88 == s.cca(a, 1))) b = parseInt(a);
        return isNaN(b) ? null : b
    };
    y.parseFloat = function (a) {
        return parseFloat(a)
    };
    y.random = function (a) {
        return 0 >= a ? 0 : Math.floor(Math.random() * a)
    };
    var Wa = function () {
        this.b = ""
    };
    f.StringBuf = Wa;
    Wa.__name__ = ["StringBuf"];
    Wa.prototype = {
        add: function (a) {
            this.b += y.string(a)
        },
        __class__: Wa
    };
    var E = function () {};
    f.StringTools = E;
    E.__name__ = ["StringTools"];
    E.startsWith = function (a, b) {
        return a.length >= b.length && s.substr(a, 0, b.length) == b
    };
    E.replace = function (a, b, c) {
        return a.split(b).join(c)
    };
    E.fastCodeAt = function (a, b) {
        return a.charCodeAt(b)
    };
    var p = f.ValueType = {
        __ename__: ["ValueType"],
        __constructs__: "TNull,TInt,TFloat,TBool,TObject,TFunction,TClass,TEnum,TUnknown".split(",")
    };
    p.TNull = ["TNull", 0];
    p.TNull.toString = q;
    p.TNull.__enum__ = p;
    p.TInt = ["TInt", 1];
    p.TInt.toString = q;
    p.TInt.__enum__ = p;
    p.TFloat = ["TFloat", 2];
    p.TFloat.toString = q;
    p.TFloat.__enum__ = p;
    p.TBool = ["TBool", 3];
    p.TBool.toString = q;
    p.TBool.__enum__ = p;
    p.TObject = ["TObject", 4];
    p.TObject.toString = q;
    p.TObject.__enum__ = p;
    p.TFunction = ["TFunction",
        5
    ];
    p.TFunction.toString = q;
    p.TFunction.__enum__ = p;
    p.TClass = function (a) {
        a = ["TClass", 6, a];
        a.__enum__ = p;
        a.toString = q;
        return a
    };
    p.TEnum = function (a) {
        a = ["TEnum", 7, a];
        a.__enum__ = p;
        a.toString = q;
        return a
    };
    p.TUnknown = ["TUnknown", 8];
    p.TUnknown.toString = q;
    p.TUnknown.__enum__ = p;
    var F = function () {};
    f.Type = F;
    F.__name__ = ["Type"];
    F.getClassName = function (a) {
        return a.__name__.join(".")
    };
    F.getEnumName = function (a) {
        return a.__ename__.join(".")
    };
    F.resolveClass = function (a) {
        a = f[a];
        return null == a || !a.__name__ ? null : a
    };
    F.resolveEnum =
        function (a) {
            a = f[a];
            return null == a || !a.__ename__ ? null : a
    };
    F.createEmptyInstance = function (a) {
        function b() {}
        b.prototype = a.prototype;
        return new b
    };
    F.createEnum = function (a, b, c) {
        var d = z.field(a, b);
        if (null == d) throw "No such constructor " + b;
        if (z.isFunction(d)) {
            if (null == c) throw "Constructor " + b + " need parameters";
            return d.apply(a, c)
        }
        if (null != c && 0 != c.length) throw "Constructor " + b + " does not need parameters";
        return d
    };
    F.getEnumConstructs = function (a) {
        return a.__constructs__.slice()
    };
    F["typeof"] = function (a) {
        switch (typeof a) {
        case "boolean":
            return p.TBool;
        case "string":
            return p.TClass(String);
        case "number":
            return Math.ceil(a) == a % 2147483648 ? p.TInt : p.TFloat;
        case "object":
            if (null == a) return p.TNull;
            var b = a.__enum__;
            if (null != b) return p.TEnum(b);
            a = a instanceof Array && null == a.__enum__ ? Array : a.__class__;
            return null != a ? p.TClass(a) : p.TObject;
        case "function":
            return a.__name__ || a.__ename__ ? p.TObject : p.TFunction;
        case "undefined":
            return p.TNull;
        default:
            return p.TUnknown
        }
    };
    var da = function () {};
    f["flambe.util.Disposable"] = da;
    da.__name__ = ["flambe", "util", "Disposable"];
    da.prototype = {
        __class__: da
    };
    var C = function () {};
    f["flambe.Component"] = C;
    C.__name__ = ["flambe", "Component"];
    C.__interfaces__ = [da];
    C.prototype = {
        onAdded: function () {},
        onRemoved: function () {},
        onUpdate: function () {},
        dispose: function () {
            null != this.owner && this.owner.remove(this)
        },
        get_name: function () {
            return null
        },
        init: function (a, b) {
            this.owner = a;
            this.next = b
        },
        __class__: C,
        __properties__: {
            get_name: "get_name"
        }
    };
    var na = function () {
        this._disposables = []
    };
    f["flambe.Disposer"] = na;
    na.__name__ = ["flambe", "Disposer"];
    na.__super__ =
        C;
    na.prototype = v(C.prototype, {
        get_name: function () {
            return "Disposer_2"
        },
        add: function (a) {
            this._disposables.push(a);
            return this
        },
        connect1: function (a, b) {
            this.add(a.connect(b));
            return this
        },
        onRemoved: function () {
            this.freeDisposables()
        },
        dispose: function () {
            C.prototype.dispose.call(this);
            this.freeDisposables()
        },
        freeDisposables: function () {
            var a = this._disposables;
            this._disposables = [];
            for (var b = 0; b < a.length;) {
                var c = a[b];
                ++b;
                c.dispose()
            }
        },
        __class__: na
    });
    var G = function () {
        this.parent = this.firstChild = this.next = this.firstComponent =
            null;
        this._compMap = {}
    };
    f["flambe.Entity"] = G;
    G.__name__ = ["flambe", "Entity"];
    G.__interfaces__ = [da];
    G.prototype = {
        add: function (a) {
            null != a.owner && a.owner.remove(a);
            var b = a.get_name(),
                c = this._compMap[b];
            null != c && this.remove(c);
            this._compMap[b] = a;
            b = null;
            for (c = this.firstComponent; null != c;) b = c, c = c.next;
            null != b ? b.next = a : this.firstComponent = a;
            a.init(this, null);
            a.onAdded();
            return this
        },
        remove: function (a) {
            for (var b = null, c = this.firstComponent; null != c;) {
                var d = c.next;
                if (c == a) return null == b ? this.firstComponent = d :
                    b.init(this, d), delete this._compMap[c.get_name()], c.onRemoved(), c.init(null, null), !0;
                b = c;
                c = d
            }
            return !1
        },
        addChild: function (a, b) {
            null == b && (b = !0);
            null != a.parent && a.parent.removeChild(a);
            a.parent = this;
            if (b) {
                for (var c = null, d = this.firstChild; null != d;) c = d, d = d.next;
                null != c ? c.next = a : this.firstChild = a
            } else a.next = this.firstChild, this.firstChild = a;
            return this
        },
        removeChild: function (a) {
            for (var b = null, c = this.firstChild; null != c;) {
                var d = c.next;
                if (c == a) {
                    null == b ? this.firstChild = d : b.next = d;
                    c.parent = null;
                    c.next = null;
                    break
                }
                b = c;
                c = d
            }
        },
        disposeChildren: function () {
            for (; null != this.firstChild;) this.firstChild.dispose()
        },
        dispose: function () {
            for (null != this.parent && this.parent.removeChild(this); null != this.firstComponent;) this.firstComponent.dispose();
            this.disposeChildren()
        },
        __class__: G
    };
    var $b = function () {};
    f["flambe.util.PackageLog"] = $b;
    $b.__name__ = ["flambe", "util", "PackageLog"];
    var Eb = function () {};
    f["flambe.platform.Platform"] = Eb;
    Eb.__name__ = ["flambe", "platform", "Platform"];
    Eb.prototype = {
        __class__: Eb
    };
    var oa = function () {};
    f["flambe.platform.html.HtmlPlatform"] = oa;
    oa.__name__ = ["flambe", "platform", "html", "HtmlPlatform"];
    oa.__interfaces__ = [Eb];
    oa.prototype = {
        init: function () {
            var a = this;
            n.fixAndroidMath();
            var b = null;
            try {
                b = window.flambe.canvas
            } catch (c) {}
            b.setAttribute("tabindex", "0");
            b.style.outlineStyle = "none";
            b.style.webkitTapHighlightColor = "transparent";
            b.setAttribute("moz-opaque", "true");
            this._stage = new ya(b);
            this._pointer = new K;
            this._mouse = new Xa(this._pointer, b);
            this._renderer = this.createRenderer(b);
            this.mainLoop = new za;
            this.musicPlaying = !1;
            this._canvas = b;
            this._container = b.parentElement;
            this._container.style.overflow = "hidden";
            this._container.style.position = "relative";
            this._container.style.msTouchAction = "none";
            var d = 0,
                h = function (c) {
                    if (!(1E3 > c.timeStamp - d)) {
                        var h = b.getBoundingClientRect(),
                            j = a.getX(c, h),
                            h = a.getY(c, h);
                        switch (c.type) {
                        case "mousedown":
                            c.target == b && (c.preventDefault(), a._mouse.submitDown(j, h, c.button), b.focus());
                            break;
                        case "mousemove":
                            a._mouse.submitMove(j, h);
                            break;
                        case "mouseup":
                            a._mouse.submitUp(j, h,
                                c.button);
                            break;
                        case "mousewheel":
                        case "DOMMouseScroll":
                            a._mouse.submitScroll(j, h, "mousewheel" == c.type ? c.wheelDelta / 40 : -c.detail) && c.preventDefault()
                        }
                    }
                };
            window.addEventListener("mousedown", h, !1);
            window.addEventListener("mousemove", h, !1);
            window.addEventListener("mouseup", h, !1);
            b.addEventListener("mousewheel", h, !1);
            b.addEventListener("DOMMouseScroll", h, !1);
            b.addEventListener("contextmenu", function (a) {
                a.preventDefault()
            }, !1);
            var j = "undefined" != typeof window.ontouchstart,
                h = "msMaxTouchPoints" in window.navigator &&
                    1 < window.navigator.msMaxTouchPoints;
            if (j || h) {
                var e = new Ya(this._pointer, j ? 4 : window.navigator.msMaxTouchPoints);
                this._touch = e;
                h = function (b) {
                    var c;
                    c = j ? b.changedTouches : [b];
                    var h = b.target.getBoundingClientRect();
                    d = b.timeStamp;
                    switch (b.type) {
                    case "touchstart":
                    case "MSPointerDown":
                    case "pointerdown":
                        b.preventDefault();
                        n.SHOULD_HIDE_MOBILE_BROWSER && n.hideMobileBrowser();
                        for (b = 0; b < c.length;) {
                            var f = c[b];
                            ++b;
                            var k = a.getX(f, h),
                                J = a.getY(f, h);
                            e.submitDown((j ? f.identifier : f.pointerId) | 0, k, J)
                        }
                        break;
                    case "touchmove":
                    case "MSPointerMove":
                    case "pointermove":
                        b.preventDefault();
                        for (b = 0; b < c.length;) f = c[b], ++b, k = a.getX(f, h), J = a.getY(f, h), e.submitMove((j ? f.identifier : f.pointerId) | 0, k, J);
                        break;
                    case "touchend":
                    case "touchcancel":
                    case "MSPointerUp":
                    case "pointerup":
                        for (b = 0; b < c.length;) f = c[b], ++b, k = a.getX(f, h), J = a.getY(f, h), e.submitUp((j ? f.identifier : f.pointerId) | 0, k, J)
                    }
                };
                j ? (b.addEventListener("touchstart", h, !1), b.addEventListener("touchmove", h, !1), b.addEventListener("touchend", h, !1), b.addEventListener("touchcancel", h, !1)) : (b.addEventListener("MSPointerDown", h, !1), b.addEventListener("MSPointerMove",
                    h, !1), b.addEventListener("MSPointerUp", h, !1))
            } else this._touch = new Za;
            var f = window.onerror;
            window.onerror = function (a, b, c) {
                l.uncaughtError.emit(a);
                return null != f ? f(a, b, c) : !1
            };
            var k = n.loadExtension("hidden", window.document);
            null != k.value ? (h = function () {
                l.hidden.set__(z.field(window.document, k.field))
            }, h(null), window.document.addEventListener(k.prefix + "visibilitychange", h, !1)) : (h = function (a) {
                l.hidden.set__("pagehide" == a.type)
            }, window.addEventListener("pageshow", h, !1), window.addEventListener("pagehide",
                h, !1));
            l.hidden.get_changed().connect(function (b) {
                b || (a._skipFrame = !0)
            });
            this._skipFrame = !1;
            this._lastUpdate = Date.now();
            var g = n.loadExtension("requestAnimationFrame").value,
                h = n.loadExtension("requestAnimationFrame").prefix;
            if (null != g && "webkit" != h) {
                var i = window.performance,
                    m = null != i && n.polyfill("now", i);
                m ? this._lastUpdate = i.now() : null;
                var o = null,
                    o = function (c) {
                        a.update(m ? i.now() : c);
                        g(o, b)
                    };
                g(o, b)
            } else window.setInterval(function () {
                a.update(Date.now())
            }, 16);
            Ja.info("Initialized HTML platform", ["renderer",
                this._renderer.get_type()
            ])
        },
        loadAssetPack: function (a) {
            return (new w(this, a)).promise
        },
        getStage: function () {
            return this._stage
        },
        getStorage: function () {
            if (null == this._storage) {
                var a = ac.getLocalStorage();
                this._storage = null != a ? new $a(a) : new ab
            }
            return this._storage
        },
        update: function (a) {
            var b = (a - this._lastUpdate) / 1E3;
            this._lastUpdate = a;
            l.hidden._value || (this._skipFrame ? this._skipFrame = !1 : (this.mainLoop.update(b), this.mainLoop.render(this._renderer)))
        },
        getPointer: function () {
            return this._pointer
        },
        getWeb: function () {
            null ==
                this._web && (this._web = new bb(this._container));
            return this._web
        },
        getRenderer: function () {
            return this._renderer
        },
        getX: function (a, b) {
            return (a.clientX - b.left) * this._stage.get_width() / b.width
        },
        getY: function (a, b) {
            return (a.clientY - b.top) * this._stage.get_height() / b.height
        },
        createRenderer: function (a) {
            return new Aa(a)
        },
        __class__: oa
    };
    var M = function (a, b) {
        this._value = a;
        this._changed = null != b ? new Ka(b) : null
    };
    f["flambe.util.Value"] = M;
    M.__name__ = ["flambe", "util", "Value"];
    M.prototype = {
        watch: function (a) {
            a(this._value,
                this._value);
            return this.get_changed().connect(a)
        },
        set__: function (a) {
            var b = this._value;
            a != b && (this._value = a, null != this._changed && this._changed.emit(a, b));
            return a
        },
        get_changed: function () {
            null == this._changed && (this._changed = new Ka);
            return this._changed
        },
        __class__: M,
        __properties__: {
            get_changed: "get_changed",
            set__: "set__"
        }
    };
    var Ba = function (a, b) {
        this._next = null;
        this._signal = a;
        this._listener = b;
        this.stayInList = !0
    };
    f["flambe.util.SignalConnection"] = Ba;
    Ba.__name__ = ["flambe", "util", "SignalConnection"];
    Ba.__interfaces__ = [da];
    Ba.prototype = {
        once: function () {
            this.stayInList = !1;
            return this
        },
        dispose: function () {
            null != this._signal && (this._signal.disconnect(this), this._signal = null)
        },
        __class__: Ba
    };
    var H = function (a) {
        this._head = null != a ? new Ba(this, a) : null;
        this._deferredTasks = null
    };
    f["flambe.util.SignalBase"] = H;
    H.__name__ = ["flambe", "util", "SignalBase"];
    H.prototype = {
        connectImpl: function (a, b) {
            var c = this,
                d = new Ba(this, a);
            this._head == H.DISPATCHING_SENTINEL ? this.defer(function () {
                c.listAdd(d, b)
            }) : this.listAdd(d, b);
            return d
        },
        disconnect: function (a) {
            var b =
                this;
            this._head == H.DISPATCHING_SENTINEL ? this.defer(function () {
                b.listRemove(a)
            }) : this.listRemove(a)
        },
        defer: function (a) {
            for (var b = null, c = this._deferredTasks; null != c;) b = c, c = c.next;
            a = new Fb(a);
            null != b ? b.next = a : this._deferredTasks = a
        },
        willEmit: function () {
            var a = this._head;
            this._head = H.DISPATCHING_SENTINEL;
            return a
        },
        didEmit: function (a) {
            this._head = a;
            a = this._deferredTasks;
            for (this._deferredTasks = null; null != a;) a.fn(), a = a.next
        },
        listAdd: function (a, b) {
            if (b) a._next = this._head, this._head = a;
            else {
                for (var c = null, d =
                        this._head; null != d;) c = d, d = d._next;
                null != c ? c._next = a : this._head = a
            }
        },
        listRemove: function (a) {
            for (var b = null, c = this._head; null != c;) {
                if (c == a) {
                    a = c._next;
                    null == b ? this._head = a : b._next = a;
                    break
                }
                b = c;
                c = c._next
            }
        },
        __class__: H
    };
    var Ka = function (a) {
        H.call(this, a)
    };
    f["flambe.util.Signal2"] = Ka;
    Ka.__name__ = ["flambe", "util", "Signal2"];
    Ka.__super__ = H;
    Ka.prototype = v(H.prototype, {
        connect: function (a, b) {
            null == b && (b = !1);
            return this.connectImpl(a, b)
        },
        emit: function (a, b) {
            var c = this;
            this._head == H.DISPATCHING_SENTINEL ? this.defer(function () {
                c.emitImpl(a,
                    b)
            }) : this.emitImpl(a, b)
        },
        emitImpl: function (a, b) {
            for (var c = this.willEmit(), d = c; null != d;) d._listener(a, b), d.stayInList || d.dispose(), d = d._next;
            this.didEmit(c)
        },
        __class__: Ka
    });
    var B = function (a) {
        H.call(this, a)
    };
    f["flambe.util.Signal1"] = B;
    B.__name__ = ["flambe", "util", "Signal1"];
    B.__super__ = H;
    B.prototype = v(H.prototype, {
        connect: function (a, b) {
            null == b && (b = !1);
            return this.connectImpl(a, b)
        },
        emit: function (a) {
            var b = this;
            this._head == H.DISPATCHING_SENTINEL ? this.defer(function () {
                b.emitImpl(a)
            }) : this.emitImpl(a)
        },
        emitImpl: function (a) {
            for (var b =
                this.willEmit(), c = b; null != c;) c._listener(a), c.stayInList || c.dispose(), c = c._next;
            this.didEmit(b)
        },
        __class__: B
    });
    var A = function (a, b) {
        this._behavior = null;
        M.call(this, a, b)
    };
    f["flambe.animation.AnimatedFloat"] = A;
    A.__name__ = ["flambe", "animation", "AnimatedFloat"];
    A.__super__ = M;
    A.prototype = v(M.prototype, {
        set__: function (a) {
            this._behavior = null;
            return M.prototype.set__.call(this, a)
        },
        update: function (a) {
            null != this._behavior && (M.prototype.set__.call(this, this._behavior.update(a)), this._behavior.isComplete() && (this._behavior =
                null))
        },
        animateTo: function (a, b, c) {
            this.set_behavior(new La(this._value, a, b, c))
        },
        set_behavior: function (a) {
            this._behavior = a;
            this.update(0);
            return a
        },
        __class__: A,
        __properties__: v(M.prototype.__properties__, {
            set_behavior: "set_behavior"
        })
    });
    var l = function () {};
    f["flambe.System"] = l;
    l.__name__ = ["flambe", "System"];
    l.init = function () {
        l._calledInit || (l._platform.init(), l._calledInit = !0)
    };
    l.loadAssetPack = function (a) {
        return l._platform.loadAssetPack(a)
    };
    var Ja = function () {};
    f["flambe.Log"] = Ja;
    Ja.__name__ = ["flambe",
        "Log"
    ];
    Ja.info = function () {
        null
    };
    Ja.__super__ = $b;
    Ja.prototype = v($b.prototype, {
        __class__: Ja
    });
    var Gb = function () {
        this._realDt = 0
    };
    f["flambe.SpeedAdjuster"] = Gb;
    Gb.__name__ = ["flambe", "SpeedAdjuster"];
    Gb.__super__ = C;
    Gb.prototype = v(C.prototype, {
        get_name: function () {
            return "SpeedAdjuster_6"
        },
        onUpdate: function (a) {
            0 < this._realDt && (a = this._realDt, this._realDt = 0);
            this.scale.update(a)
        },
        __class__: Gb
    });
    var cb = function () {};
    f["flambe.animation.Behavior"] = cb;
    cb.__name__ = ["flambe", "animation", "Behavior"];
    cb.prototype = {
        __class__: cb
    };
    var m = function () {};
    f["flambe.animation.Ease"] = m;
    m.__name__ = ["flambe", "animation", "Ease"];
    m.linear = function (a) {
        return a
    };
    m.quadIn = function (a) {
        return a * a
    };
    m.quadOut = function (a) {
        return a * (2 - a)
    };
    m.cubeOut = function (a) {
        return 1 + --a * a * a
    };
    m.bounceIn = function (a) {
        a = 1 - a;
        return 0.36363636363636365 > a ? 1 - 7.5625 * a * a : 0.7272727272727273 > a ? 1 - (7.5625 * (a - 0.5454545454545454) * (a - 0.5454545454545454) + 0.75) : 0.9090909090909091 > a ? 1 - (7.5625 * (a - 0.8181818181818182) * (a - 0.8181818181818182) + 0.9375) : 1 - (7.5625 * (a - 0.9545454545454546) *
            (a - 0.9545454545454546) + 0.984375)
    };
    m.bounceOut = function (a) {
        return 0.36363636363636365 > a ? 7.5625 * a * a : 0.7272727272727273 > a ? 7.5625 * (a - 0.5454545454545454) * (a - 0.5454545454545454) + 0.75 : 0.9090909090909091 > a ? 7.5625 * (a - 0.8181818181818182) * (a - 0.8181818181818182) + 0.9375 : 7.5625 * (a - 0.9545454545454546) * (a - 0.9545454545454546) + 0.984375
    };
    m.bounceInOut = function (a) {
        if (0.5 > a) return a = 1 - 2 * a, 0.36363636363636365 > a ? (1 - 7.5625 * a * a) / 2 : 0.7272727272727273 > a ? (1 - (7.5625 * (a - 0.5454545454545454) * (a - 0.5454545454545454) + 0.75)) / 2 : 0.9090909090909091 >
            a ? (1 - (7.5625 * (a - 0.8181818181818182) * (a - 0.8181818181818182) + 0.9375)) / 2 : (1 - (7.5625 * (a - 0.9545454545454546) * (a - 0.9545454545454546) + 0.984375)) / 2;
        a = 2 * a - 1;
        return 0.36363636363636365 > a ? 7.5625 * a * a / 2 + 0.5 : 0.7272727272727273 > a ? (7.5625 * (a - 0.5454545454545454) * (a - 0.5454545454545454) + 0.75) / 2 + 0.5 : 0.9090909090909091 > a ? (7.5625 * (a - 0.8181818181818182) * (a - 0.8181818181818182) + 0.9375) / 2 + 0.5 : (7.5625 * (a - 0.9545454545454546) * (a - 0.9545454545454546) + 0.984375) / 2 + 0.5
    };
    m.backIn = function (a) {
        return a * a * (2.70158 * a - 1.70158)
    };
    m.backOut =
        function (a) {
            return 1 - --a * a * (-2.70158 * a - 1.70158)
    };
    m.backInOut = function (a) {
        a *= 2;
        if (1 > a) return a * a * (2.70158 * a - 1.70158) / 2;
        a -= 2;
        return (1 - a * a * (-2.70158 * a - 1.70158)) / 2 + 0.5
    };
    var ra = function (a, b) {
        this.base = a;
        this.strength = b
    };
    f["flambe.animation.Jitter"] = ra;
    ra.__name__ = ["flambe", "animation", "Jitter"];
    ra.__interfaces__ = [cb];
    ra.prototype = {
        update: function () {
            return this.base + 2 * Math.random() * this.strength - this.strength
        },
        isComplete: function () {
            return !1
        },
        __class__: ra
    };
    var La = function (a, b, c, d) {
        this._from = a;
        this._to =
            b;
        this._duration = c;
        this.elapsed = 0;
        this._easing = null != d ? d : m.linear
    };
    f["flambe.animation.Tween"] = La;
    La.__name__ = ["flambe", "animation", "Tween"];
    La.__interfaces__ = [cb];
    La.prototype = {
        update: function (a) {
            this.elapsed += a;
            return this.elapsed >= this._duration ? this._to : this._from + (this._to - this._from) * this._easing(this.elapsed / this._duration)
        },
        isComplete: function () {
            return this.elapsed >= this._duration
        },
        __class__: La
    };
    var ta = function () {};
    f["flambe.asset.Asset"] = ta;
    ta.__name__ = ["flambe", "asset", "Asset"];
    ta.__interfaces__ = [da];
    ta.prototype = {
        __class__: ta
    };
    var g = f["flambe.asset.AssetFormat"] = {
        __ename__: ["flambe", "asset", "AssetFormat"],
        __constructs__: "WEBP,JXR,PNG,JPG,GIF,DDS,PVR,PKM,MP3,M4A,OPUS,OGG,WAV,Data".split(",")
    };
    g.WEBP = ["WEBP", 0];
    g.WEBP.toString = q;
    g.WEBP.__enum__ = g;
    g.JXR = ["JXR", 1];
    g.JXR.toString = q;
    g.JXR.__enum__ = g;
    g.PNG = ["PNG", 2];
    g.PNG.toString = q;
    g.PNG.__enum__ = g;
    g.JPG = ["JPG", 3];
    g.JPG.toString = q;
    g.JPG.__enum__ = g;
    g.GIF = ["GIF", 4];
    g.GIF.toString = q;
    g.GIF.__enum__ = g;
    g.DDS = ["DDS", 5];
    g.DDS.toString = q;
    g.DDS.__enum__ =
        g;
    g.PVR = ["PVR", 6];
    g.PVR.toString = q;
    g.PVR.__enum__ = g;
    g.PKM = ["PKM", 7];
    g.PKM.toString = q;
    g.PKM.__enum__ = g;
    g.MP3 = ["MP3", 8];
    g.MP3.toString = q;
    g.MP3.__enum__ = g;
    g.M4A = ["M4A", 9];
    g.M4A.toString = q;
    g.M4A.__enum__ = g;
    g.OPUS = ["OPUS", 10];
    g.OPUS.toString = q;
    g.OPUS.__enum__ = g;
    g.OGG = ["OGG", 11];
    g.OGG.toString = q;
    g.OGG.__enum__ = g;
    g.WAV = ["WAV", 12];
    g.WAV.toString = q;
    g.WAV.__enum__ = g;
    g.Data = ["Data", 13];
    g.Data.toString = q;
    g.Data.__enum__ = g;
    var Hb = function (a, b, c, d) {
        this.name = a;
        this.url = b;
        this.format = c;
        this.bytes = d
    };
    f["flambe.asset.AssetEntry"] =
        Hb;
    Hb.__name__ = ["flambe", "asset", "AssetEntry"];
    Hb.prototype = {
        __class__: Hb
    };
    var db = function () {};
    f["flambe.asset.AssetPack"] = db;
    db.__name__ = ["flambe", "asset", "AssetPack"];
    db.__interfaces__ = [da];
    db.prototype = {
        __class__: db
    };
    var eb = function () {};
    f["flambe.asset.File"] = eb;
    eb.__name__ = ["flambe", "asset", "File"];
    eb.__interfaces__ = [ta];
    eb.prototype = {
        __class__: eb
    };
    var T = function () {
        this._localBase = this._remoteBase = null;
        this._entries = []
    };
    f["flambe.asset.Manifest"] = T;
    T.__name__ = ["flambe", "asset", "Manifest"];
    T.fromAssets =
        function (a, b) {
            null == b && (b = !0);
            var c = z.field(bc.getType(T).assets[0], a);
            if (null == c) {
                if (b) throw I.withFields("Missing asset pack", ["name", a]);
                return null
            }
            var d = new T;
            d.set_localBase("/game-carful/assets");
            for (var h = 0; h < c.length;) {
                var j = c[h];
                ++h;
                var e = j.name,
                    f = a + "/" + e + "?v=" + y.string(j.md5),
                    k = T.inferFormat(e);
                k != g.Data && (e = I.removeFileExtension(e));
                d.add(e, f, j.bytes, k)
            }
            return d
    };
    T.inferFormat = function (a) {
        a = I.getUrlExtension(a);
        if (null != a) switch (a.toLowerCase()) {
        case "gif":
            return g.GIF;
        case "jpg":
        case "jpeg":
            return g.JPG;
        case "jxr":
        case "wdp":
            return g.JXR;
        case "png":
            return g.PNG;
        case "webp":
            return g.WEBP;
        case "dds":
            return g.DDS;
        case "pvr":
            return g.PVR;
        case "pkm":
            return g.PKM;
        case "m4a":
            return g.M4A;
        case "mp3":
            return g.MP3;
        case "ogg":
            return g.OGG;
        case "opus":
            return g.OPUS;
        case "wav":
            return g.WAV
        } else null;
        return g.Data
    };
    T.prototype = {
        add: function (a, b, c, d) {
            null == c && (c = 0);
            null == d && (d = T.inferFormat(b));
            a = new Hb(a, b, d, c);
            this._entries.push(a);
            return a
        },
        iterator: function () {
            return s.iter(this._entries)
        },
        getFullURL: function (a) {
            var b;
            b = null != this.get_remoteBase() && T._supportsCrossOrigin ? this.get_remoteBase() : this.get_localBase();
            return null != b ? I.joinPath(b, a.url) : a.url
        },
        get_localBase: function () {
            return this._localBase
        },
        set_localBase: function (a) {
            null != a && cc.that(!E.startsWith(a, "http://") && !E.startsWith(a, "https://"), "localBase must be a path on the same domain, NOT starting with http(s)://", null);
            return this._localBase = a
        },
        get_remoteBase: function () {
            return this._remoteBase
        },
        __class__: T,
        __properties__: {
            get_remoteBase: "get_remoteBase",
            set_localBase: "set_localBase",
            get_localBase: "get_localBase"
        }
    };
    var R = f["flambe.display.BlendMode"] = {
        __ename__: ["flambe", "display", "BlendMode"],
        __constructs__: ["Normal", "Add", "Mask", "Copy"]
    };
    R.Normal = ["Normal", 0];
    R.Normal.toString = q;
    R.Normal.__enum__ = R;
    R.Add = ["Add", 1];
    R.Add.toString = q;
    R.Add.__enum__ = R;
    R.Mask = ["Mask", 2];
    R.Mask.toString = q;
    R.Mask.__enum__ = R;
    R.Copy = ["Copy", 3];
    R.Copy.toString = q;
    R.Copy.__enum__ = R;
    var r = function () {
        this.blendMode = this.scissor = null;
        var a = this;
        this._flags = 139;
        this._localMatrix =
            new Ib;
        var b = function () {
            a._flags |= 12
        };
        this.x = new A(0, b);
        this.y = new A(0, b);
        this.rotation = new A(0, b);
        this.scaleX = new A(1, b);
        this.scaleY = new A(1, b);
        this.anchorX = new A(0, b);
        this.anchorY = new A(0, b);
        this.alpha = new A(1)
    };
    f["flambe.display.Sprite"] = r;
    r.__name__ = ["flambe", "display", "Sprite"];
    r.hitTest = function (a, b, c) {
        var d = a._compMap.Sprite_0;
        if (null != d) {
            if (3 != (d._flags & 3)) return null;
            d.getLocalMatrix().inverseTransform(b, c, r._scratchPoint) && (b = r._scratchPoint.x, c = r._scratchPoint.y);
            var h = d.scissor;
            if (null !=
                h && !h.contains(b, c)) return null
        }
        a = r.hitTestBackwards(a.firstChild, b, c);
        return null != a ? a : null != d && d.containsLocal(b, c) ? d : null
    };
    r.render = function (a, b) {
        var c = a._compMap.Sprite_0;
        if (null != c) {
            var d = c.alpha._value;
            if (0 == (c._flags & 1) || 0 >= d) return;
            b.save();
            1 > d && b.multiplyAlpha(d);
            null != c.blendMode && b.setBlendMode(c.blendMode);
            var d = c.getLocalMatrix(),
                h = d.m02,
                j = d.m12;
            0 != (c._flags & 128) && (h = Math.round(h), j = Math.round(j));
            b.transform(d.m00, d.m10, d.m01, d.m11, h, j);
            d = c.scissor;
            null != d && b.applyScissor(d.x, d.y, d.width,
                d.height);
            c.draw(b)
        }
        d = a._compMap.Director_5;
        if (null != d) {
            d = d.occludedScenes;
            for (h = 0; h < d.length;) j = d[h], ++h, r.render(j, b)
        }
        for (d = a.firstChild; null != d;) h = d.next, r.render(d, b), d = h;
        null != c && b.restore()
    };
    r.hitTestBackwards = function (a, b, c) {
        if (null != a) {
            var d = r.hitTestBackwards(a.next, b, c);
            return null != d ? d : r.hitTest(a, b, c)
        }
        return null
    };
    r.__super__ = C;
    r.prototype = v(C.prototype, {
        get_name: function () {
            return "Sprite_0"
        },
        getNaturalWidth: function () {
            return 0
        },
        getNaturalHeight: function () {
            return 0
        },
        containsLocal: function (a,
            b) {
            return 0 <= a && a < this.getNaturalWidth() && 0 <= b && b < this.getNaturalHeight()
        },
        getLocalMatrix: function () {
            0 != (this._flags & 4) && (this._flags &= -5, this._localMatrix.compose(this.x._value, this.y._value, this.scaleX._value, this.scaleY._value, 3.141592653589793 * this.rotation._value / 180), this._localMatrix.translate(-this.anchorX._value, -this.anchorY._value));
            return this._localMatrix
        },
        centerAnchor: function () {
            this.anchorX.set__(this.getNaturalWidth() / 2);
            this.anchorY.set__(this.getNaturalHeight() / 2);
            return this
        },
        setXY: function (a,
            b) {
            this.x.set__(a);
            this.y.set__(b);
            return this
        },
        setAlpha: function (a) {
            this.alpha.set__(a);
            return this
        },
        setRotation: function (a) {
            this.rotation.set__(a);
            return this
        },
        setScale: function (a) {
            this.scaleX.set__(a);
            this.scaleY.set__(a);
            return this
        },
        onAdded: function () {
            0 != (this._flags & 256) && this.connectHover()
        },
        onRemoved: function () {
            null != this._hoverConnection && (this._hoverConnection.dispose(), this._hoverConnection = null)
        },
        onUpdate: function (a) {
            this.x.update(a);
            this.y.update(a);
            this.rotation.update(a);
            this.scaleX.update(a);
            this.scaleY.update(a);
            this.alpha.update(a);
            this.anchorX.update(a);
            this.anchorY.update(a)
        },
        draw: function () {},
        getParentSprite: function () {
            if (null == this.owner) return null;
            for (var a = this.owner.parent; null != a;) {
                var b = a._compMap.Sprite_0;
                if (null != b) return b;
                a = a.parent
            }
            return null
        },
        get_pointerDown: function () {
            null == this._pointerDown && (this._pointerDown = new B);
            return this._pointerDown
        },
        get_pointerUp: function () {
            null == this._pointerUp && (this._pointerUp = new B);
            return this._pointerUp
        },
        connectHover: function () {
            var a =
                this;
            null == this._hoverConnection && (this._hoverConnection = l._platform.getPointer().move.connect(function (b) {
                for (var c = b.hit; null != c;) {
                    if (c == a) return;
                    c = c.getParentSprite()
                }
                null != a._pointerOut && 0 != (a._flags & 256) && a._pointerOut.emit(b);
                a._flags &= -257;
                a._hoverConnection.dispose();
                a._hoverConnection = null
            }))
        },
        set_visible: function (a) {
            this._flags = dc.set(this._flags, 1, a);
            return a
        },
        onPointerDown: function (a) {
            this.onHover(a);
            null != this._pointerDown && this._pointerDown.emit(a)
        },
        onPointerMove: function (a) {
            this.onHover(a);
            null != this._pointerMove && this._pointerMove.emit(a)
        },
        onHover: function (a) {
            if (0 == (this._flags & 256) && (this._flags |= 256, null != this._pointerIn || null != this._pointerOut)) null != this._pointerIn && this._pointerIn.emit(a), this.connectHover()
        },
        onPointerUp: function (a) {
            switch (a.source[1]) {
            case 1:
                null != this._pointerOut && 0 != (this._flags & 256) && this._pointerOut.emit(a), this._flags &= -257, null != this._hoverConnection && (this._hoverConnection.dispose(), this._hoverConnection = null)
            }
            null != this._pointerUp && this._pointerUp.emit(a)
        },
        __class__: r,
        __properties__: v(C.prototype.__properties__, {
            set_visible: "set_visible",
            get_pointerUp: "get_pointerUp",
            get_pointerDown: "get_pointerDown"
        })
    });
    var fb = function (a, b, c) {
        r.call(this);
        this.color = a;
        this.width = new A(b);
        this.height = new A(c)
    };
    f["flambe.display.FillSprite"] = fb;
    fb.__name__ = ["flambe", "display", "FillSprite"];
    fb.__super__ = r;
    fb.prototype = v(r.prototype, {
        draw: function (a) {
            a.fillRect(this.color, 0, 0, this.width._value, this.height._value)
        },
        getNaturalWidth: function () {
            return this.width._value
        },
        getNaturalHeight: function () {
            return this.height._value
        },
        setSize: function (a, b) {
            this.width.set__(a);
            this.height.set__(b);
            return this
        },
        onUpdate: function (a) {
            r.prototype.onUpdate.call(this, a);
            this.width.update(a);
            this.height.update(a)
        },
        __class__: fb
    });
    var gb = function (a) {
        this._kernings = null;
        this.xOffset = this.yOffset = this.xAdvance = 0;
        this.page = null;
        this.x = this.y = this.width = this.height = 0;
        this.charCode = a
    };
    f["flambe.display.Glyph"] = gb;
    gb.__name__ = ["flambe", "display", "Glyph"];
    gb.prototype = {
        draw: function (a, b, c) {
            0 < this.width && a.drawSubTexture(this.page, b + this.xOffset,
                c + this.yOffset, this.x, this.y, this.width, this.height)
        },
        getKerning: function (a) {
            return null != this._kernings ? y["int"](this._kernings.get(a)) : 0
        },
        setKerning: function (a, b) {
            null == this._kernings && (this._kernings = new aa);
            this._kernings.set(a, b)
        },
        __class__: gb
    };
    var Ca = function (a, b) {
        this.name = b;
        this._pack = a;
        this.reload()
    };
    f["flambe.display.Font"] = Ca;
    Ca.__name__ = ["flambe", "display", "Font"];
    Ca.prototype = {
        layoutText: function (a, b, c, d, h) {
            null == h && (h = 0);
            null == d && (d = 0);
            null == c && (c = 0);
            null == b && (b = U.Left);
            return new ua(this,
                a, b, c, d, h)
        },
        reload: function () {
            this._glyphs = new aa;
            this._glyphs.set(Ca.NEWLINE.charCode, Ca.NEWLINE);
            for (var a = new Da(this._pack.getFile(this.name + ".fnt").toString()), b = new aa, c = this.name.lastIndexOf("/"), c = 0 <= c ? s.substr(this.name, 0, c + 1) : "", d = a.keywords(); d.hasNext();) switch (d.next()) {
            case "info":
                for (var h = a.pairs(); h.hasNext();) {
                    var j = h.next();
                    switch (j.key) {
                    case "size":
                        this.size = j.getInt()
                    }
                }
                break;
            case "common":
                for (h = a.pairs(); h.hasNext();) switch (j = h.next(), j.key) {
                case "lineHeight":
                    this.lineHeight =
                        j.getInt()
                }
                break;
            case "page":
                for (var h = 0, j = null, e = a.pairs(); e.hasNext();) {
                    var f = e.next();
                    switch (f.key) {
                    case "id":
                        h = f.getInt();
                        break;
                    case "file":
                        j = f.getString()
                    }
                }
                j = this._pack.getTexture(c + I.removeFileExtension(j));
                b.set(h, j);
                break;
            case "char":
                h = null;
                for (j = a.pairs(); j.hasNext();) switch (e = j.next(), e.key) {
                case "id":
                    h = new gb(e.getInt());
                    break;
                case "x":
                    h.x = e.getInt();
                    break;
                case "y":
                    h.y = e.getInt();
                    break;
                case "width":
                    h.width = e.getInt();
                    break;
                case "height":
                    h.height = e.getInt();
                    break;
                case "page":
                    e = e.getInt();
                    h.page = b.get(e);
                    break;
                case "xoffset":
                    h.xOffset = e.getInt();
                    break;
                case "yoffset":
                    h.yOffset = e.getInt();
                    break;
                case "xadvance":
                    h.xAdvance = e.getInt()
                }
                this._glyphs.set(h.charCode, h);
                break;
            case "kerning":
                h = null;
                e = j = 0;
                for (f = a.pairs(); f.hasNext();) {
                    var k = f.next();
                    switch (k.key) {
                    case "first":
                        h = this._glyphs.get(k.getInt());
                        break;
                    case "second":
                        j = k.getInt();
                        break;
                    case "amount":
                        e = k.getInt()
                    }
                }
                null != h && 0 != e && h.setKerning(j, e)
            }
        },
        __class__: Ca
    };
    var U = f["flambe.display.TextAlign"] = {
        __ename__: ["flambe", "display", "TextAlign"],
        __constructs__: ["Left", "Center", "Right"]
    };
    U.Left = ["Left", 0];
    U.Left.toString = q;
    U.Left.__enum__ = U;
    U.Center = ["Center", 1];
    U.Center.toString = q;
    U.Center.__enum__ = U;
    U.Right = ["Right", 2];
    U.Right.toString = q;
    U.Right.__enum__ = U;
    var ua = function (a, b, c, d, h, e) {
        this.lines = 0;
        var f = this;
        this._font = a;
        this._glyphs = [];
        this._offsets = [];
        this._lineOffset = Math.round(a.lineHeight + e);
        this.bounds = new Jb;
        for (var J = [], e = b.length, k = 0; k < e;) {
            var g = k++,
                g = b.charCodeAt(g),
                g = a._glyphs.get(g);
            null != g ? this._glyphs.push(g) : null
        }
        for (var b = -1, i = 0, l = 0, a = a._glyphs.get(10), e = function () {
                f.bounds.width = hb.max(f.bounds.width, i);
                f.bounds.height += l;
                J[f.lines] = i;
                l = i = 0;
                ++f.lines
            }, k = 0; k < this._glyphs.length;) {
            g = this._glyphs[k];
            this._offsets[k] = Math.round(i);
            var m = 0 < d && i + g.width > d;
            m || g == a ? (m && (0 <= b ? (this._glyphs[b] = a, i = this._offsets[b], k = b) : this._glyphs.splice(k, 0, a)), b = -1, l = this._lineOffset, e()) : (32 == g.charCode && (b = k), i += g.xAdvance + h, l = hb.max(l, g.height + g.yOffset), k + 1 < this._glyphs.length && (i += g.getKerning(this._glyphs[k + 1].charCode)));
            ++k
        }
        e();
        h = 0;
        a = ua.getAlignOffset(c, J[0], d);
        b = 1.79769313486231E308;
        e = -1.79769313486231E308;
        g = k = 0;
        for (m = this._glyphs.length; g < m;) {
            var o = this._glyphs[g];
            10 == o.charCode && (h += this._lineOffset, ++k, a = ua.getAlignOffset(c, J[k], d));
            this._offsets[g] += a;
            var n = h + o.yOffset;
            b < n || (b = n);
            e = hb.max(e, n + o.height);
            ++g
        }
        this.bounds.x = ua.getAlignOffset(c, this.bounds.width, d);
        this.bounds.y = b;
        this.bounds.height = e - b
    };
    f["flambe.display.TextLayout"] = ua;
    ua.__name__ = ["flambe", "display", "TextLayout"];
    ua.getAlignOffset = function (a, b, c) {
        switch (a[1]) {
        case 0:
            return 0;
        case 2:
            return c - b;
        case 1:
            return Math.round((c - b) / 2)
        }
    };
    ua.prototype = {
        draw: function (a) {
            for (var b = 0, c = 0, d = this._glyphs.length; c < d;) {
                var h = this._glyphs[c];
                10 == h.charCode ? b += this._lineOffset : h.draw(a, this._offsets[c], b);
                ++c
            }
        },
        __class__: ua
    };
    var Da = function (a) {
        this._configText = a;
        this._keywordPattern = new X("([A-Za-z]+)(.*)", "");
        this._pairPattern = new X('([A-Za-z]+)=("[^"]*"|[^\\s]+)', "")
    };
    f["flambe.display._Font.ConfigParser"] = Da;
    Da.__name__ = ["flambe", "display", "_Font", "ConfigParser"];
    Da.advance = function (a,
        b) {
        var c = b.matchedPos();
        return s.substr(a, c.pos + c.len, a.length)
    };
    Da.prototype = {
        keywords: function () {
            var a = this,
                b = this._configText;
            return {
                next: function () {
                    b = Da.advance(b, a._keywordPattern);
                    a._pairText = a._keywordPattern.matched(2);
                    return a._keywordPattern.matched(1)
                },
                hasNext: function () {
                    return a._keywordPattern.match(b)
                }
            }
        },
        pairs: function () {
            var a = this,
                b = this._pairText;
            return {
                next: function () {
                    b = Da.advance(b, a._pairPattern);
                    return new Kb(a._pairPattern.matched(1), a._pairPattern.matched(2))
                },
                hasNext: function () {
                    return a._pairPattern.match(b)
                }
            }
        },
        __class__: Da
    };
    var Kb = function (a, b) {
        this.key = a;
        this._value = b
    };
    f["flambe.display._Font.ConfigPair"] = Kb;
    Kb.__name__ = ["flambe", "display", "_Font", "ConfigPair"];
    Kb.prototype = {
        getInt: function () {
            return y.parseInt(this._value)
        },
        getString: function () {
            return 34 != this._value.charCodeAt(0) ? null : s.substr(this._value, 1, this._value.length - 2)
        },
        __class__: Kb
    };
    var Lb = function () {};
    f["flambe.display.Graphics"] = Lb;
    Lb.__name__ = ["flambe", "display", "Graphics"];
    Lb.prototype = {
        __class__: Lb
    };
    var ib = function (a) {
        r.call(this);
        this.texture =
            a
    };
    f["flambe.display.ImageSprite"] = ib;
    ib.__name__ = ["flambe", "display", "ImageSprite"];
    ib.__super__ = r;
    ib.prototype = v(r.prototype, {
        draw: function (a) {
            null != this.texture && a.drawTexture(this.texture, 0, 0)
        },
        getNaturalWidth: function () {
            return null != this.texture ? this.texture.get_width() : 0
        },
        getNaturalHeight: function () {
            return null != this.texture ? this.texture.get_height() : 0
        },
        __class__: ib
    });
    var ea = f["flambe.display.Orientation"] = {
        __ename__: ["flambe", "display", "Orientation"],
        __constructs__: ["Portrait", "Landscape"]
    };
    ea.Portrait = ["Portrait", 0];
    ea.Portrait.toString = q;
    ea.Portrait.__enum__ = ea;
    ea.Landscape = ["Landscape", 1];
    ea.Landscape.toString = q;
    ea.Landscape.__enum__ = ea;
    var jb = function (a, b, c) {
        null == c && (c = -1);
        null == b && (b = -1);
        r.call(this);
        this.texture = a;
        0 > b && (b = null != a ? a.get_width() : 0);
        this.width = new A(b);
        0 > c && (c = null != a ? a.get_height() : 0);
        this.height = new A(c)
    };
    f["flambe.display.PatternSprite"] = jb;
    jb.__name__ = ["flambe", "display", "PatternSprite"];
    jb.__super__ = r;
    jb.prototype = v(r.prototype, {
        draw: function (a) {
            null != this.texture &&
                a.drawPattern(this.texture, 0, 0, this.width._value, this.height._value)
        },
        getNaturalWidth: function () {
            return this.width._value
        },
        getNaturalHeight: function () {
            return this.height._value
        },
        onUpdate: function (a) {
            r.prototype.onUpdate.call(this, a);
            this.width.update(a);
            this.height.update(a)
        },
        __class__: jb
    });
    var kb = function () {};
    f["flambe.display.Texture"] = kb;
    kb.__name__ = ["flambe", "display", "Texture"];
    kb.__interfaces__ = [ta];
    kb.prototype = {
        __class__: kb
    };
    var ec = function () {};
    f["flambe.display.SubTexture"] = ec;
    ec.__name__ = ["flambe", "display", "SubTexture"];
    ec.__interfaces__ = [kb];
    var lb = function (a, b) {
        null == b && (b = "");
        this._layout = null;
        var c = this;
        r.call(this);
        this._font = a;
        this._text = b;
        this._align = U.Left;
        this._flags |= 64;
        var d = function () {
            c._flags |= 64
        };
        this.wrapWidth = new A(0, d);
        this.letterSpacing = new A(0, d);
        this.lineSpacing = new A(0, d)
    };
    f["flambe.display.TextSprite"] = lb;
    lb.__name__ = ["flambe", "display", "TextSprite"];
    lb.__super__ = r;
    lb.prototype = v(r.prototype, {
        draw: function (a) {
            this.updateLayout();
            this._layout.draw(a)
        },
        getNaturalWidth: function () {
            this.updateLayout();
            return 0 < this.wrapWidth._value ? this.wrapWidth._value : this._layout.bounds.width
        },
        getNaturalHeight: function () {
            this.updateLayout();
            var a = this._layout.lines * (this._font.lineHeight + this.lineSpacing._value),
                b = this._layout.bounds.height;
            return a > b ? a : b
        },
        containsLocal: function (a, b) {
            this.updateLayout();
            return this._layout.bounds.contains(a, b)
        },
        setWrapWidth: function (a) {
            this.wrapWidth.set__(a);
            return this
        },
        setAlign: function (a) {
            this.set_align(a);
            return this
        },
        set_text: function (a) {
            a != this._text && (this._text = a, this._flags |=
                64);
            return a
        },
        set_align: function (a) {
            a != this._align && (this._align = a, this._flags |= 64);
            return a
        },
        updateLayout: function () {
            0 != (this._flags & 64) && (this._flags &= -65, this._layout = this._font.layoutText(this._text, this._align, this.wrapWidth._value, this.letterSpacing._value, this.lineSpacing._value))
        },
        onUpdate: function (a) {
            r.prototype.onUpdate.call(this, a);
            this.wrapWidth.update(a);
            this.letterSpacing.update(a);
            this.lineSpacing.update(a)
        },
        __class__: lb,
        __properties__: v(r.prototype.__properties__, {
            set_align: "set_align",
            set_text: "set_text"
        })
    });
    var L = f["flambe.input.MouseButton"] = {
        __ename__: ["flambe", "input", "MouseButton"],
        __constructs__: ["Left", "Middle", "Right", "Unknown"]
    };
    L.Left = ["Left", 0];
    L.Left.toString = q;
    L.Left.__enum__ = L;
    L.Middle = ["Middle", 1];
    L.Middle.toString = q;
    L.Middle.__enum__ = L;
    L.Right = ["Right", 2];
    L.Right.toString = q;
    L.Right.__enum__ = L;
    L.Unknown = function (a) {
        a = ["Unknown", 3, a];
        a.__enum__ = L;
        a.toString = q;
        return a
    };
    var ba = f["flambe.input.MouseCursor"] = {
        __ename__: ["flambe", "input", "MouseCursor"],
        __constructs__: ["Default",
            "Button", "None"
        ]
    };
    ba.Default = ["Default", 0];
    ba.Default.toString = q;
    ba.Default.__enum__ = ba;
    ba.Button = ["Button", 1];
    ba.Button.toString = q;
    ba.Button.__enum__ = ba;
    ba.None = ["None", 2];
    ba.None.toString = q;
    ba.None.__enum__ = ba;
    var Mb = function () {
        this.init(0, 0, 0, null)
    };
    f["flambe.input.MouseEvent"] = Mb;
    Mb.__name__ = ["flambe", "input", "MouseEvent"];
    Mb.prototype = {
        init: function (a, b, c, d) {
            this.id = a;
            this.viewX = b;
            this.viewY = c;
            this.button = d
        },
        __class__: Mb
    };
    var mb = f["flambe.input.EventSource"] = {
        __ename__: ["flambe", "input", "EventSource"],
        __constructs__: ["Mouse", "Touch"]
    };
    mb.Mouse = function (a) {
        a = ["Mouse", 0, a];
        a.__enum__ = mb;
        a.toString = q;
        return a
    };
    mb.Touch = function (a) {
        a = ["Touch", 1, a];
        a.__enum__ = mb;
        a.toString = q;
        return a
    };
    var Nb = function () {
        this.init(0, 0, 0, null, null)
    };
    f["flambe.input.PointerEvent"] = Nb;
    Nb.__name__ = ["flambe", "input", "PointerEvent"];
    Nb.prototype = {
        init: function (a, b, c, d, h) {
            this.id = a;
            this.viewX = b;
            this.viewY = c;
            this.hit = d;
            this.source = h;
            this._stopped = !1
        },
        __class__: Nb
    };
    var Ob = function (a) {
        this.id = a;
        this._source = mb.Touch(this)
    };
    f["flambe.input.TouchPoint"] =
        Ob;
    Ob.__name__ = ["flambe", "input", "TouchPoint"];
    Ob.prototype = {
        init: function (a, b) {
            this.viewX = a;
            this.viewY = b
        },
        __class__: Ob
    };
    var hb = function () {};
    f["flambe.math.FMath"] = hb;
    hb.__name__ = ["flambe", "math", "FMath"];
    hb.max = function (a, b) {
        return a > b ? a : b
    };
    var Ib = function () {
        this.identity()
    };
    f["flambe.math.Matrix"] = Ib;
    Ib.__name__ = ["flambe", "math", "Matrix"];
    Ib.prototype = {
        set: function (a, b, c, d, h, e) {
            this.m00 = a;
            this.m01 = c;
            this.m02 = h;
            this.m10 = b;
            this.m11 = d;
            this.m12 = e
        },
        identity: function () {
            this.set(1, 0, 0, 1, 0, 0)
        },
        compose: function (a,
            b, c, d, h) {
            var e = Math.sin(h),
                h = Math.cos(h);
            this.set(h * c, e * c, -e * d, h * d, a, b)
        },
        translate: function (a, b) {
            this.m02 += this.m00 * a + this.m01 * b;
            this.m12 += this.m11 * b + this.m10 * a
        },
        determinant: function () {
            return this.m00 * this.m11 - this.m01 * this.m10
        },
        inverseTransform: function (a, b, c) {
            var d = this.determinant();
            if (0 == d) return !1;
            a -= this.m02;
            b -= this.m12;
            c.x = (a * this.m11 - b * this.m01) / d;
            c.y = (b * this.m00 - a * this.m10) / d;
            return !0
        },
        __class__: Ib
    };
    var Jb = function (a, b, c, d) {
        null == d && (d = 0);
        null == c && (c = 0);
        null == b && (b = 0);
        null == a && (a = 0);
        this.set(a,
            b, c, d)
    };
    f["flambe.math.Rectangle"] = Jb;
    Jb.__name__ = ["flambe", "math", "Rectangle"];
    Jb.prototype = {
        set: function (a, b, c, d) {
            this.x = a;
            this.y = b;
            this.width = c;
            this.height = d
        },
        contains: function (a, b) {
            a -= this.x;
            if (0 <= this.width) {
                if (0 > a || a > this.width) return !1
            } else if (0 < a || a < this.width) return !1;
            b -= this.y;
            if (0 <= this.height) {
                if (0 > b || b > this.height) return !1
            } else if (0 < b || b < this.height) return !1;
            return !0
        },
        __class__: Jb
    };
    var N = function () {
        this._disposed = !1
    };
    f["flambe.platform.BasicAsset"] = N;
    N.__name__ = ["flambe", "platform", "BasicAsset"];
    N.__interfaces__ = [ta];
    N.prototype = {
        dispose: function () {
            this._disposed || (this._disposed = !0, this.onDisposed())
        },
        onDisposed: function () {
            null
        },
        __class__: N
    };
    var va = function (a, b) {
        var c = this;
        this.manifest = b;
        this._platform = a;
        this.promise = new nb;
        this._bytesLoaded = new O;
        this._pack = new ob(b, this);
        var d = ma.array(b);
        if (0 == d.length) this.handleSuccess();
        else {
            for (var h = new O, e = 0; e < d.length;) {
                var f = d[e];
                ++e;
                var g = h.get(f.name);
                null == g && (g = [], h.set(f.name, g));
                g.push(f)
            }
            this._assetsRemaining = ma.count(h);
            for (d = h.iterator(); d.hasNext();) h = [d.next()], this.pickBestEntry(h[0], function (a) {
                return function (d) {
                    if (null != d) {
                        var h = b.getFullURL(d);
                        try {
                            c.loadEntry(h, d)
                        } catch (e) {
                            c.handleError(d, "Unexpected error: " + y.string(e))
                        }
                        h = c.promise;
                        h.set_total(h._total + d.bytes)
                    } else d = a[0][0], va.isAudio(d.format) ? c.handleLoad(d, Z.getInstance()) : c.handleError(d, "Could not find a supported format to load")
                }
            }(h))
        }
    };
    f["flambe.platform.BasicAssetPackLoader"] = va;
    va.__name__ = ["flambe", "platform", "BasicAssetPackLoader"];
    va.isAudio = function (a) {
        switch (a[1]) {
        case 8:
        case 9:
        case 10:
        case 11:
        case 12:
            return !0;
        default:
            return !1
        }
    };
    va.prototype = {
        onDisposed: function () {},
        pickBestEntry: function (a, b) {
            this.getAssetFormats(function (c) {
                for (var d = 0; d < c.length;) {
                    var h = c[d];
                    ++d;
                    for (var e = 0; e < a.length;) {
                        var f = a[e];
                        ++e;
                        if (f.format == h) {
                            b(f);
                            return
                        }
                    }
                }
                b(null)
            })
        },
        loadEntry: function () {
            null
        },
        getAssetFormats: function () {
            null
        },
        handleLoad: function (a, b) {
            if (!this._pack.disposed) {
                this.handleProgress(a, a.bytes);
                var c;
                switch (a.format[1]) {
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 7:
                    c = this._pack.textures;
                    break;
                case 8:
                case 9:
                case 10:
                case 11:
                case 12:
                    c =
                        this._pack.sounds;
                    break;
                case 13:
                    c = this._pack.files
                }
                c.set(a.name, b);
                this._assetsRemaining -= 1;
                0 == this._assetsRemaining && this.handleSuccess()
            }
        },
        handleProgress: function (a, b) {
            this._bytesLoaded.set(a.name, b);
            for (var c = 0, d = this._bytesLoaded.iterator(); d.hasNext();) var h = d.next(),
            c = c + h;
            this.promise.set_progress(c)
        },
        handleSuccess: function () {
            this.promise.set_result(this._pack)
        },
        handleError: function (a, b) {
            this.promise.error.emit(I.withFields(b, ["url", a.url]))
        },
        handleTextureError: function (a) {
            this.handleError(a,
                "Failed to create texture. Is the GPU context unavailable?")
        },
        __class__: va
    };
    var ob = function (a, b) {
        this.disposed = !1;
        this._manifest = a;
        this.loader = b;
        this.textures = new O;
        this.sounds = new O;
        this.files = new O
    };
    f["flambe.platform._BasicAssetPackLoader.BasicAssetPack"] = ob;
    ob.__name__ = ["flambe", "platform", "_BasicAssetPackLoader", "BasicAssetPack"];
    ob.__interfaces__ = [db];
    ob.prototype = {
        getTexture: function (a, b) {
            null == b && (b = !0);
            var c = this.textures.get(a);
            if (null == c && b) throw I.withFields("Missing texture", ["name",
                a
            ]);
            return c
        },
        getSound: function (a, b) {
            null == b && (b = !0);
            var c = this.sounds.get(a);
            if (null == c && b) throw I.withFields("Missing sound", ["name", a]);
            return c
        },
        getFile: function (a, b) {
            null == b && (b = !0);
            var c = this.files.get(a);
            if (null == c && b) throw I.withFields("Missing file", ["name", a]);
            return c
        },
        dispose: function () {
            if (!this.disposed) {
                this.disposed = !0;
                for (var a = this.textures.iterator(); a.hasNext();) a.next().dispose();
                this.textures = null;
                for (a = this.sounds.iterator(); a.hasNext();) a.next().dispose();
                this.sounds = null;
                for (a =
                    this.files.iterator(); a.hasNext();) a.next().dispose();
                this.files = null;
                this.loader.onDisposed()
            }
        },
        __class__: ob
    };
    var Ma = function (a) {
        this._disposed = !1;
        this._content = a
    };
    f["flambe.platform.BasicFile"] = Ma;
    Ma.__name__ = ["flambe", "platform", "BasicFile"];
    Ma.__interfaces__ = [eb];
    Ma.__super__ = N;
    Ma.prototype = v(N.prototype, {
        toString: function () {
            return this._content
        },
        onDisposed: function () {
            this._content = null
        },
        __class__: Ma
    });
    var gc = function () {};
    f["flambe.subsystem.MouseSystem"] = gc;
    gc.__name__ = ["flambe", "subsystem",
        "MouseSystem"
    ];
    var V = function (a) {
        this._pointer = a;
        this._source = mb.Mouse(V._sharedEvent);
        this.down = new B;
        this.move = new B;
        this.up = new B;
        this.scroll = new B;
        this._y = this._x = 0;
        this._cursor = ba.Default;
        this._buttonStates = new aa
    };
    f["flambe.platform.BasicMouse"] = V;
    V.__name__ = ["flambe", "platform", "BasicMouse"];
    V.__interfaces__ = [gc];
    V.prototype = {
        submitDown: function (a, b, c) {
            this._buttonStates.exists(c) || (this._buttonStates.set(c, !0), this.prepare(a, b, Pb.toButton(c)), this._pointer.submitDown(a, b, this._source), this.down.emit(V._sharedEvent))
        },
        submitMove: function (a, b) {
            this.prepare(a, b, null);
            this._pointer.submitMove(a, b, this._source);
            this.move.emit(V._sharedEvent)
        },
        submitUp: function (a, b, c) {
            this._buttonStates.exists(c) && (this._buttonStates.remove(c), this.prepare(a, b, Pb.toButton(c)), this._pointer.submitUp(a, b, this._source), this.up.emit(V._sharedEvent))
        },
        submitScroll: function (a, b, c) {
            this._x = a;
            this._y = b;
            if (null == this.scroll._head) return !1;
            this.scroll.emit(c);
            return !0
        },
        prepare: function (a, b, c) {
            this._x = a;
            this._y = b;
            V._sharedEvent.init(V._sharedEvent.id +
                1, a, b, c)
        },
        __class__: V 
    };
    var Qb = function () {};
    f["flambe.subsystem.PointerSystem"] = Qb;
    Qb.__name__ = ["flambe", "subsystem", "PointerSystem"];
    Qb.prototype = {
        __class__: Qb
    };
    var K = function (a, b, c) {
        null == c && (c = !1);
        null == b && (b = 0);
        null == a && (a = 0);
        this.down = new B;
        this.move = new B;
        this.up = new B;
        this._x = a;
        this._y = b;
        this._isDown = c
    };
    f["flambe.platform.BasicPointer"] = K;
    K.__name__ = ["flambe", "platform", "BasicPointer"];
    K.__interfaces__ = [Qb];
    K.prototype = {
        submitDown: function (a, b, c) {
            if (!this._isDown) {
                this.submitMove(a, b, c);
                this._isDown = !0;
                var d = [],
                    h = r.hitTest(l.root, a, b);
                if (null != h) {
                    var e = h.owner;
                    do {
                        var f = e._compMap.Sprite_0;
                        null != f && d.push(f);
                        e = e.parent
                    } while (null != e)
                }
                this.prepare(a, b, h, c);
                for (a = 0; a < d.length;)
                    if (b = d[a], ++a, b.onPointerDown(K._sharedEvent), K._sharedEvent._stopped) return;
                this.down.emit(K._sharedEvent)
            }
        },
        submitMove: function (a, b, c) {
            if (!(a == this._x && b == this._y)) {
                var d = [],
                    h = r.hitTest(l.root, a, b);
                if (null != h) {
                    var e = h.owner;
                    do {
                        var f = e._compMap.Sprite_0;
                        null != f && d.push(f);
                        e = e.parent
                    } while (null != e)
                }
                this.prepare(a, b, h, c);
                for (a =
                    0; a < d.length;)
                    if (b = d[a], ++a, b.onPointerMove(K._sharedEvent), K._sharedEvent._stopped) return;
                this.move.emit(K._sharedEvent)
            }
        },
        submitUp: function (a, b, c) {
            if (this._isDown) {
                this.submitMove(a, b, c);
                this._isDown = !1;
                var d = [],
                    h = r.hitTest(l.root, a, b);
                if (null != h) {
                    var e = h.owner;
                    do {
                        var f = e._compMap.Sprite_0;
                        null != f && d.push(f);
                        e = e.parent
                    } while (null != e)
                }
                this.prepare(a, b, h, c);
                for (a = 0; a < d.length;)
                    if (b = d[a], ++a, b.onPointerUp(K._sharedEvent), K._sharedEvent._stopped) return;
                this.up.emit(K._sharedEvent)
            }
        },
        prepare: function (a,
            b, c, d) {
            this._x = a;
            this._y = b;
            K._sharedEvent.init(K._sharedEvent.id + 1, a, b, c, d)
        },
        __class__: K
    };
    var wa = function (a, b, c) {
        this._parent = null;
        this.rootX = this.rootY = 0;
        this._disposed = !1;
        this.root = a;
        this._width = b;
        this._height = c
    };
    f["flambe.platform.BasicTexture"] = wa;
    wa.__name__ = ["flambe", "platform", "BasicTexture"];
    wa.__interfaces__ = [ec];
    wa.__super__ = N;
    wa.prototype = v(N.prototype, {
        onDisposed: function () {
            null == this._parent && this.root.dispose()
        },
        get_width: function () {
            return this._width
        },
        get_height: function () {
            return this._height
        },
        __class__: wa,
        __properties__: {
            get_height: "get_height",
            get_width: "get_width"
        }
    });
    var fc = function () {};
    f["flambe.subsystem.TouchSystem"] = fc;
    fc.__name__ = ["flambe", "subsystem", "TouchSystem"];
    var Ya = function (a, b) {
        null == b && (b = 4);
        this._pointer = a;
        this._maxPoints = b;
        this._pointMap = new aa;
        this._points = [];
        this.down = new B;
        this.move = new B;
        this.up = new B
    };
    f["flambe.platform.BasicTouch"] = Ya;
    Ya.__name__ = ["flambe", "platform", "BasicTouch"];
    Ya.__interfaces__ = [fc];
    Ya.prototype = {
        submitDown: function (a, b, c) {
            if (!this._pointMap.exists(a)) {
                var d =
                    new Ob(a);
                d.init(b, c);
                this._pointMap.set(a, d);
                this._points.push(d);
                null == this._pointerTouch && (this._pointerTouch = d, this._pointer.submitDown(b, c, d._source));
                this.down.emit(d)
            }
        },
        submitMove: function (a, b, c) {
            a = this._pointMap.get(a);
            null != a && (a.init(b, c), this._pointerTouch == a && this._pointer.submitMove(b, c, a._source), this.move.emit(a))
        },
        submitUp: function (a, b, c) {
            var d = this._pointMap.get(a);
            null != d && (d.init(b, c), this._pointMap.remove(a), s.remove(this._points, d), this._pointerTouch == d && (this._pointerTouch = null,
                this._pointer.submitUp(b, c, d._source)), this.up.emit(d))
        },
        __class__: Ya
    };
    var Ea = function () {};
    f["flambe.sound.Sound"] = Ea;
    Ea.__name__ = ["flambe", "sound", "Sound"];
    Ea.__interfaces__ = [ta];
    Ea.prototype = {
        __class__: Ea
    };
    var Z = function () {
        this._disposed = !1;
        this._playback = new pb(this)
    };
    f["flambe.platform.DummySound"] = Z;
    Z.__name__ = ["flambe", "platform", "DummySound"];
    Z.__interfaces__ = [Ea];
    Z.getInstance = function () {
        null == Z._instance && (Z._instance = new Z);
        return Z._instance
    };
    Z.__super__ = N;
    Z.prototype = v(N.prototype, {
        play: function () {
            return this._playback
        },
        loop: function () {
            return this._playback
        },
        onDisposed: function () {},
        __class__: Z
    });
    var Fa = function () {};
    f["flambe.sound.Playback"] = Fa;
    Fa.__name__ = ["flambe", "sound", "Playback"];
    Fa.__interfaces__ = [da];
    Fa.prototype = {
        __class__: Fa
    };
    var pb = function (a) {
        this._sound = a;
        this.volume = new A(0);
        this._complete = new M(!0)
    };
    f["flambe.platform.DummyPlayback"] = pb;
    pb.__name__ = ["flambe", "platform", "DummyPlayback"];
    pb.__interfaces__ = [Fa];
    pb.prototype = {
        get_sound: function () {
            return this._sound
        },
        set_paused: function () {
            return !0
        },
        dispose: function () {},
        __class__: pb,
        __properties__: {
            get_sound: "get_sound",
            set_paused: "set_paused"
        }
    };
    var qb = function () {};
    f["flambe.subsystem.StorageSystem"] = qb;
    qb.__name__ = ["flambe", "subsystem", "StorageSystem"];
    qb.prototype = {
        __class__: qb
    };
    var ab = function () {
        this.clear()
    };
    f["flambe.platform.DummyStorage"] = ab;
    ab.__name__ = ["flambe", "platform", "DummyStorage"];
    ab.__interfaces__ = [qb];
    ab.prototype = {
        set: function (a, b) {
            this._hash.set(a, b);
            return !0
        },
        get: function (a, b) {
            return this._hash.exists(a) ? this._hash.get(a) : b
        },
        clear: function () {
            this._hash =
                new O
        },
        __class__: ab
    };
    var Za = function () {
        this.down = new B;
        this.move = new B;
        this.up = new B
    };
    f["flambe.platform.DummyTouch"] = Za;
    Za.__name__ = ["flambe", "platform", "DummyTouch"];
    Za.__interfaces__ = [fc];
    Za.prototype = {
        __class__: Za
    };
    var Na = function () {
        this._entries = []
    };
    f["flambe.platform.EventGroup"] = Na;
    Na.__name__ = ["flambe", "platform", "EventGroup"];
    Na.__interfaces__ = [da];
    Na.prototype = {
        addListener: function (a, b, c) {
            a.addEventListener(b, c, !1);
            this._entries.push(new Rb(a, b, c))
        },
        addDisposingListener: function (a, b, c) {
            var d =
                this;
            this.addListener(a, b, function (a) {
                d.dispose();
                c(a)
            })
        },
        dispose: function () {
            for (var a = 0, b = this._entries; a < b.length;) {
                var c = b[a];
                ++a;
                c.dispatcher.removeEventListener(c.type, c.listener, !1)
            }
            this._entries = []
        },
        __class__: Na
    };
    var Rb = function (a, b, c) {
        this.dispatcher = a;
        this.type = b;
        this.listener = c
    };
    f["flambe.platform._EventGroup.Entry"] = Rb;
    Rb.__name__ = ["flambe", "platform", "_EventGroup", "Entry"];
    Rb.prototype = {
        __class__: Rb
    };
    var rb = function () {};
    f["flambe.platform.InternalGraphics"] = rb;
    rb.__name__ = ["flambe", "platform",
        "InternalGraphics"
    ];
    rb.__interfaces__ = [Lb];
    rb.prototype = {
        __class__: rb
    };
    var Sb = function () {};
    f["flambe.subsystem.RendererSystem"] = Sb;
    Sb.__name__ = ["flambe", "subsystem", "RendererSystem"];
    Sb.prototype = {
        __class__: Sb
    };
    var sb = function () {};
    f["flambe.platform.InternalRenderer"] = sb;
    sb.__name__ = ["flambe", "platform", "InternalRenderer"];
    sb.__interfaces__ = [Sb];
    sb.prototype = {
        __class__: sb
    };
    var za = function () {
        this._tickables = []
    };
    f["flambe.platform.MainLoop"] = za;
    za.__name__ = ["flambe", "platform", "MainLoop"];
    za.updateEntity =
        function (a, b) {
            var c = a._compMap.SpeedAdjuster_6;
            if (null != c && (c._realDt = b, b *= c.scale._value, 0 >= b)) {
                c.onUpdate(b);
                return
            }
            for (c = a.firstComponent; null != c;) {
                var d = c.next;
                c.onUpdate(b);
                c = d
            }
            for (c = a.firstChild; null != c;) d = c.next, za.updateEntity(c, b), c = d
    };
    za.prototype = {
        update: function (a) {
            if (!(0 >= a)) {
                1 < a && (a = 1);
                for (var b = 0; b < this._tickables.length;) {
                    var c = this._tickables[b];
                    null == c || c.update(a) ? this._tickables.splice(b, 1) : ++b
                }
                l.volume.update(a);
                za.updateEntity(l.root, a)
            }
        },
        render: function (a) {
            var b = a.graphics;
            null != b && (a.willRender(), r.render(l.root, b), a.didRender())
        },
        addTickable: function (a) {
            this._tickables.push(a)
        },
        __class__: za
    };
    var Pb = function () {};
    f["flambe.platform.MouseCodes"] = Pb;
    Pb.__name__ = ["flambe", "platform", "MouseCodes"];
    Pb.toButton = function (a) {
        switch (a) {
        case 0:
            return L.Left;
        case 1:
            return L.Middle;
        case 2:
            return L.Right
        }
        return L.Unknown(a)
    };
    var hc = function () {};
    f["flambe.platform.TextureRoot"] = hc;
    hc.__name__ = ["flambe", "platform", "TextureRoot"];
    var tb = function () {};
    f["flambe.platform.Tickable"] = tb;
    tb.__name__ = ["flambe", "platform", "Tickable"];
    tb.prototype = {
        __class__: tb
    };
    var ub = function (a) {
        this._firstDraw = !1;
        this._canvasCtx = a.getContext("2d")
    };
    f["flambe.platform.html.CanvasGraphics"] = ub;
    ub.__name__ = ["flambe", "platform", "html", "CanvasGraphics"];
    ub.__interfaces__ = [rb];
    ub.prototype = {
        save: function () {
            this._canvasCtx.save()
        },
        transform: function (a, b, c, d, h, e) {
            this._canvasCtx.transform(a, b, c, d, h, e)
        },
        restore: function () {
            this._canvasCtx.restore()
        },
        drawTexture: function (a, b, c) {
            this.drawSubTexture(a, b, c, 0, 0,
                a.get_width(), a.get_height())
        },
        drawSubTexture: function (a, b, c, d, h, e, f) {
            this._firstDraw ? (this._firstDraw = !1, this._canvasCtx.globalCompositeOperation = "copy", this.drawSubTexture(a, b, c, d, h, e, f), this._canvasCtx.globalCompositeOperation = "source-over") : this._canvasCtx.drawImage(a.root.image, a.rootX + d | 0, a.rootY + h | 0, e | 0, f | 0, b | 0, c | 0, e | 0, f | 0)
        },
        drawPattern: function (a, b, c, d, e) {
            this._firstDraw ? (this._firstDraw = !1, this._canvasCtx.globalCompositeOperation = "copy", this.drawPattern(a, b, c, d, e), this._canvasCtx.globalCompositeOperation =
                "source-over") : (this._canvasCtx.fillStyle = a.getPattern(), this._canvasCtx.fillRect(b | 0, c | 0, d | 0, e | 0))
        },
        fillRect: function (a, b, c, d, e) {
            if (this._firstDraw) this._firstDraw = !1, this._canvasCtx.globalCompositeOperation = "copy", this.fillRect(a, b, c, d, e), this._canvasCtx.globalCompositeOperation = "source-over";
            else {
                for (a = (16777215 & a).toString(16); 6 > a.length;) a = "0" + y.string(a);
                this._canvasCtx.fillStyle = "#" + y.string(a);
                this._canvasCtx.fillRect(b | 0, c | 0, d | 0, e | 0)
            }
        },
        multiplyAlpha: function (a) {
            this._canvasCtx.globalAlpha *=
                a
        },
        setBlendMode: function (a) {
            var b;
            switch (a[1]) {
            case 0:
                b = "source-over";
                break;
            case 1:
                b = "lighter";
                break;
            case 2:
                b = "destination-in";
                break;
            case 3:
                b = "copy"
            }
            this._canvasCtx.globalCompositeOperation = b
        },
        applyScissor: function (a, b, c, d) {
            this._canvasCtx.beginPath();
            this._canvasCtx.rect(a | 0, b | 0, c | 0, d | 0);
            this._canvasCtx.clip()
        },
        willRender: function () {
            this._firstDraw = !0
        },
        didRender: function () {},
        __class__: ub
    };
    var Aa = function (a) {
        this.graphics = new ub(a);
        this._hasGPU = new M(!0)
    };
    f["flambe.platform.html.CanvasRenderer"] =
        Aa;
    Aa.__name__ = ["flambe", "platform", "html", "CanvasRenderer"];
    Aa.__interfaces__ = [sb];
    Aa.prototype = {
        get_type: function () {
            return ca.Canvas
        },
        createTextureFromImage: function (a) {
            a = new Oa(Aa.CANVAS_TEXTURES ? n.createCanvas(a) : a);
            return a.createTexture(a.width, a.height)
        },
        getCompressedTextureFormats: function () {
            return []
        },
        createCompressedTexture: function () {
            return null
        },
        willRender: function () {
            this.graphics.willRender()
        },
        didRender: function () {
            this.graphics.didRender()
        },
        __class__: Aa,
        __properties__: {
            get_type: "get_type"
        }
    };
    var vb = function (a, b, c) {
        this._rootUpdateCount = 0;
        this._pattern = null;
        wa.call(this, a, b, c)
    };
    f["flambe.platform.html.CanvasTexture"] = vb;
    vb.__name__ = ["flambe", "platform", "html", "CanvasTexture"];
    vb.__super__ = wa;
    vb.prototype = v(wa.prototype, {
        getPattern: function () {
            if (this._rootUpdateCount != this.root.updateCount || null == this._pattern) this._rootUpdateCount = this.root.updateCount, this._pattern = this.root.createPattern(this.rootX, this.rootY, this._width, this._height);
            return this._pattern
        },
        __class__: vb
    });
    var Oa = function (a) {
        this._graphics =
            null;
        this.updateCount = 0;
        this._disposed = !1;
        this.image = a;
        this.width = a.width;
        this.height = a.height
    };
    f["flambe.platform.html.CanvasTextureRoot"] = Oa;
    Oa.__name__ = ["flambe", "platform", "html", "CanvasTextureRoot"];
    Oa.__interfaces__ = [hc];
    Oa.__super__ = N;
    Oa.prototype = v(N.prototype, {
        createTexture: function (a, b) {
            return new vb(this, a, b)
        },
        createPattern: function (a, b, c, d) {
            var e = this.getContext2d(),
                j = this.image;
            if (0 != a || 0 != b || c != this.width || d != this.height) j = n.createEmptyCanvas(c, d), c = j.getContext("2d"), c.globalCompositeOperation =
                "copy", c.drawImage(this.image, -a, -b);
            return e.createPattern(j, "repeat")
        },
        getContext2d: function () {
            D.__instanceof(this.image, HTMLCanvasElement) || (this.image = n.createCanvas(this.image));
            return this.image.getContext("2d")
        },
        onDisposed: function () {
            this._graphics = this.image = null
        },
        __class__: Oa
    });
    var w = function (a, b) {
        va.call(this, a, b)
    };
    f["flambe.platform.html.HtmlAssetPackLoader"] = w;
    w.__name__ = ["flambe", "platform", "html", "HtmlAssetPackLoader"];
    w.detectImageFormats = function (a) {
        var b = [g.PNG, g.JPG, g.GIF],
            c = 2,
            d;
        d = window.document.createElement("img");
        d.onload = d.onerror = function () {
            1 == d.width && b.unshift(g.WEBP);
            --c;
            0 == c && a(b)
        };
        d.src = "";
        var e;
        e = window.document.createElement("img");
        e.onload = e.onerror = function () {
            1 == e.width && b.unshift(g.JXR);
            --c;
            0 == c && a(b)
        };
        e.src = ""
    };
    w.detectAudioFormats = function () {
        var a;
        a = window.document.createElement("audio");
        if (null == a || null == fa(a, a.canPlayType)) return [];
        var b = new X("\\b(iPhone|iPod|iPad|Android|Windows Phone)\\b", ""),
            c = window.navigator.userAgent;
        if (!u.get_supported() && b.match(c)) return [];
        for (var b = [{
                format: g.M4A,
                mimeType: "audio/mp4; codecs=mp4a"
            }, {
                format: g.MP3,
                mimeType: "audio/mpeg"
            }, {
                format: g.OPUS,
                mimeType: "audio/ogg; codecs=opus"
            }, {
                format: g.OGG,
                mimeType: "audio/ogg; codecs=vorbis"
            }, {
                format: g.WAV,
                mimeType: "audio/wav"
            }], c = [],
                d = 0; d < b.length;) {
            var e = b[d];
            ++d;
            var j = "";
            try {
                j = a.canPlayType(e.mimeType)
            } catch (f) {}
            "" != j && c.push(e.format)
        }
        return c
    };
    w.supportsBlob = function () {
        if (w._detectBlobSupport) {
            w._detectBlobSupport = !1;
            if ((new X("\\bSilk\\b", "")).match(window.navigator.userAgent) || null == window.Blob) return !1;
            var a = new XMLHttpRequest;
            a.open("GET", ".", !0);
            if ("" != a.responseType) return !1;
            a.responseType = "blob";
            if ("blob" != a.responseType) return !1;
            w._URL = n.loadExtension("URL").value
        }
        return null != w._URL && null != w._URL.createObjectURL
    };
    w.__super__ = va;
    w.prototype = v(va.prototype, {
        loadEntry: function (a, b) {
            var c = this;
            switch (b.format[1]) {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
                var d;
                d = window.document.createElement("img");
                var e = new Na;
                e.addDisposingListener(d, "load", function () {
                    w.supportsBlob() && w._URL.revokeObjectURL(d.src);
                    var a = c._platform.getRenderer().createTextureFromImage(d);
                    null != a ? c.handleLoad(b, a) : c.handleTextureError(b)
                });
                e.addDisposingListener(d, "error", function () {
                    c.handleError(b, "Failed to load image")
                });
                w.supportsBlob() ? this.download(a,
                    b, "blob", function (a) {
                        d.src = w._URL.createObjectURL(a)
                    }) : d.src = a;
                break;
            case 5:
            case 6:
            case 7:
                this.download(a, b, "arraybuffer", function () {
                    var a = c._platform.getRenderer().createCompressedTexture(b.format, null);
                    null != a ? c.handleLoad(b, a) : c.handleTextureError(b)
                });
                break;
            case 8:
            case 9:
            case 10:
            case 11:
            case 12:
                if (u.get_supported()) this.download(a, b, "arraybuffer", function (a) {
                    u.ctx.decodeAudioData(a, function (a) {
                        c.handleLoad(b, new u(a))
                    }, function () {
                        c.handleLoad(b, Z.getInstance())
                    })
                });
                else {
                    var j;
                    j = window.document.createElement("audio");
                    j.preload = "auto";
                    var f = ++w._mediaRefCount;
                    null == w._mediaElements && (w._mediaElements = new aa);
                    w._mediaElements.set(f, j);
                    e = new Na;
                    e.addDisposingListener(j, "canplaythrough", function () {
                        w._mediaElements.remove(f);
                        c.handleLoad(b, new Pa(j))
                    });
                    e.addDisposingListener(j, "error", function () {
                        w._mediaElements.remove(f);
                        var a = j.error.code;
                        3 == a || 4 == a ? c.handleLoad(b, Z.getInstance()) : c.handleError(b, "Failed to load audio: " + j.error.code)
                    });
                    e.addListener(j, "progress", function () {
                        if (0 < j.buffered.length && 0 < j.duration) {
                            var a =
                                j.buffered.end(0) / j.duration;
                            c.handleProgress(b, a * b.bytes | 0)
                        }
                    });
                    j.src = a;
                    j.load()
                }
                break;
            case 13:
                this.download(a, b, "text", function (a) {
                    c.handleLoad(b, new Ma(a))
                })
            }
        },
        getAssetFormats: function (a) {
            var b = this;
            null == w._supportedFormats && (w._supportedFormats = new nb, w.detectImageFormats(function (a) {
                w._supportedFormats.set_result(b._platform.getRenderer().getCompressedTextureFormats().concat(a).concat(w.detectAudioFormats()).concat([g.Data]))
            }));
            w._supportedFormats.get(a)
        },
        download: function (a, b, c, d) {
            var e = this,
                j = null,
                f = null,
                g = 0,
                k = !1,
                i = function () {
                    k && (k = !1, window.clearInterval(g))
                }, l = 3,
                m = function () {
                    --l;
                    return 0 <= l ? (f(), !0) : !1
                }, f = function () {
                    i();
                    null != j && j.abort();
                    j = new XMLHttpRequest;
                    j.open("GET", a, !0);
                    j.responseType = c;
                    var f = 0;
                    j.onprogress = function (a) {
                        k || (k = !0, g = window.setInterval(function () {
                            4 != j.readyState && 5E3 < Date.now() - f && !m() && (i(), e.handleError(b, "Download stalled"))
                        }, 1E3));
                        f = Date.now();
                        e.handleProgress(b, a.loaded)
                    };
                    j.onerror = function () {
                        if (0 != j.status || !m()) i(), e.handleError(b, "HTTP error " + j.status)
                    };
                    j.onload = function () {
                        var a = j.response;
                        null == a && (a = j.responseText);
                        i();
                        d(a)
                    };
                    j.send()
                };
            f()
        },
        __class__: w
    });
    var Xa = function (a, b) {
        V.call(this, a);
        this._canvas = b
    };
    f["flambe.platform.html.HtmlMouse"] = Xa;
    Xa.__name__ = ["flambe", "platform", "html", "HtmlMouse"];
    Xa.__super__ = V;
    Xa.prototype = v(V.prototype, {
        __class__: Xa
    });
    var Pa = function (a) {
        this._disposed = !1;
        this.audioElement = a
    };
    f["flambe.platform.html.HtmlSound"] = Pa;
    Pa.__name__ = ["flambe", "platform", "html", "HtmlSound"];
    Pa.__interfaces__ = [Ea];
    Pa.__super__ = N;
    Pa.prototype =
        v(N.prototype, {
            play: function (a) {
                null == a && (a = 1);
                return new Qa(this, a, !1)
            },
            loop: function (a) {
                null == a && (a = 1);
                return new Qa(this, a, !0)
            },
            onDisposed: function () {
                this.audioElement = null
            },
            __class__: Pa
        });
    var Qa = function (a, b, c) {
        var d = this;
        this._sound = a;
        this._tickableAdded = !1;
        this._clonedElement = window.document.createElement("audio");
        this._clonedElement.loop = c;
        this._clonedElement.src = a.audioElement.src;
        this.volume = new A(b, function () {
            d.updateVolume()
        });
        this.updateVolume();
        this._complete = new M(!1);
        this.playAudio();
        l.hidden._value && this.set_paused(!0)
    };
    f["flambe.platform.html._HtmlSound.HtmlPlayback"] = Qa;
    Qa.__name__ = ["flambe", "platform", "html", "_HtmlSound", "HtmlPlayback"];
    Qa.__interfaces__ = [tb, Fa];
    Qa.prototype = {
        get_sound: function () {
            return this._sound
        },
        set_paused: function (a) {
            this._clonedElement.paused != a && (a ? this._clonedElement.pause() : this.playAudio());
            return a
        },
        update: function (a) {
            this.volume.update(a);
            this._complete.set__(this._clonedElement.ended);
            return this._complete._value || this._clonedElement.paused ? (this._tickableAdded = !1, this._volumeBinding.dispose(), this._hideBinding.dispose(), !0) : !1
        },
        dispose: function () {
            this.set_paused(!0);
            this._complete.set__(!0)
        },
        playAudio: function () {
            var a = this;
            this._clonedElement.play();
            this._tickableAdded || (oa.instance.mainLoop.addTickable(this), this._tickableAdded = !0, this._volumeBinding = l.volume.get_changed().connect(function () {
                a.updateVolume()
            }), this._hideBinding = l.hidden.get_changed().connect(function (b) {
                b ? (a._wasPaused = a._clonedElement.paused, a.set_paused(!0)) : a.set_paused(a._wasPaused)
            }))
        },
        updateVolume: function () {
            this._clonedElement.volume = l.volume._value * this.volume._value
        },
        __class__: Qa,
        __properties__: {
            get_sound: "get_sound",
            set_paused: "set_paused"
        }
    };
    var Tb = function () {};
    f["flambe.subsystem.StageSystem"] = Tb;
    Tb.__name__ = ["flambe", "subsystem", "StageSystem"];
    Tb.prototype = {
        __class__: Tb
    };
    var ya = function (a) {
        var b = this;
        this._canvas = a;
        this.resize = new pa;
        this.scaleFactor = ya.computeScaleFactor();
        1 != this.scaleFactor && (n.setVendorStyle(this._canvas, "transform-origin", "top left"), n.setVendorStyle(this._canvas,
            "transform", "scale(" + 1 / this.scaleFactor + ")"));
        n.SHOULD_HIDE_MOBILE_BROWSER && (window.addEventListener("orientationchange", function () {
            n.callLater(fa(b, b.hideMobileBrowser), 200)
        }, !1), this.hideMobileBrowser());
        window.addEventListener("resize", fa(this, this.onWindowResize), !1);
        this.onWindowResize(null);
        this.orientation = new M(null);
        null != window.orientation && (window.addEventListener("orientationchange", fa(this, this.onOrientationChange), !1), this.onOrientationChange(null));
        this.fullscreen = new M(!1);
        n.addVendorListener(window.document,
            "fullscreenchange", function () {
                b.updateFullscreen()
            }, !1);
        this.updateFullscreen()
    };
    f["flambe.platform.html.HtmlStage"] = ya;
    ya.__name__ = ["flambe", "platform", "html", "HtmlStage"];
    ya.__interfaces__ = [Tb];
    ya.computeScaleFactor = function () {
        var a = window.devicePixelRatio;
        null == a && (a = 1);
        var b = window.document.createElement("canvas").getContext("2d"),
            b = n.loadExtension("backingStorePixelRatio", b).value;
        null == b && (b = 1);
        a /= b;
        b = window.screen.height;
        return 1536 < a * window.screen.width || 1536 < a * b ? 1 : a
    };
    ya.prototype = {
        get_width: function () {
            return this._canvas.width
        },
        get_height: function () {
            return this._canvas.height
        },
        lockOrientation: function (a) {
            var b = n.loadExtension("lockOrientation", window.screen).value;
            if (null != b) {
                var c;
                switch (a[1]) {
                case 0:
                    c = "portrait";
                    break;
                case 1:
                    c = "landscape"
                }
                b.apply(window.screen, [c]) || null
            }
        },
        requestFullscreen: function (a) {
            null == a && (a = !0);
            if (a) {
                var a = window.document.documentElement,
                    b = n.loadFirstExtension(["requestFullscreen", "requestFullScreen"], a).value;
                null != b && b.apply(a, [])
            } else a = n.loadFirstExtension(["cancelFullscreen", "cancelFullScreen"],
                window.document).value, null != a && z.callMethod(window.document, a, [])
        },
        onWindowResize: function () {
            var a = this._canvas.parentElement.getBoundingClientRect();
            this.resizeCanvas(a.width, a.height)
        },
        resizeCanvas: function (a, b) {
            var c = this.scaleFactor * a,
                d = this.scaleFactor * b;
            if (this._canvas.width == c && this._canvas.height == d) return !1;
            this._canvas.width = c | 0;
            this._canvas.height = d | 0;
            this.resize.emit();
            return !0
        },
        hideMobileBrowser: function () {
            var a = this,
                b = window.document.documentElement.style;
            b.height = window.innerHeight +
                100 + "px";
            b.width = window.innerWidth + "px";
            b.overflow = "visible";
            n.callLater(function () {
                n.hideMobileBrowser();
                n.callLater(function () {
                    b.height = window.innerHeight + "px";
                    a.onWindowResize(null)
                }, 100)
            })
        },
        onOrientationChange: function () {
            this.orientation.set__(n.orientation(window.orientation))
        },
        updateFullscreen: function () {
            this.fullscreen.set__(!0 == n.loadFirstExtension(["fullscreen", "fullScreen", "isFullScreen"], window.document).value)
        },
        __class__: ya,
        __properties__: {
            get_height: "get_height",
            get_width: "get_width"
        }
    };
    var $a = function (a) {
        this._storage = a
    };
    f["flambe.platform.html.HtmlStorage"] = $a;
    $a.__name__ = ["flambe", "platform", "html", "HtmlStorage"];
    $a.__interfaces__ = [qb];
    $a.prototype = {
        set: function (a, b) {
            var c;
            try {
                var d = new ia;
                d.useCache = !0;
                d.useEnumIndex = !1;
                d.serialize(b);
                c = d.toString()
            } catch (e) {
                return !1
            }
            try {
                this._storage.setItem("flambe:" + a, c)
            } catch (f) {
                return !1
            }
            return !0
        },
        get: function (a, b) {
            var c = null;
            try {
                c = this._storage.getItem("flambe:" + a)
            } catch (d) {
                null
            }
            if (null != c) try {
                return P.run(c)
            } catch (e) {
                null
            }
            return b
        },
        __class__: $a
    };
    var n = function () {};
    f["flambe.platform.html.HtmlUtil"] = n;
    n.__name__ = ["flambe", "platform", "html", "HtmlUtil"];
    n.callLater = function (a, b) {
        null == b && (b = 0);
        window.setTimeout(a, b)
    };
    n.hideMobileBrowser = function () {
        window.scrollTo(1, 0)
    };
    n.loadExtension = function (a, b) {
        null == b && (b = window);
        var c = z.field(b, a);
        if (null != c) return {
            prefix: "",
            field: a,
            value: c
        };
        for (var c = a.charAt(0).toUpperCase() + s.substr(a, 1, null), d = 0, e = n.VENDOR_PREFIXES; d < e.length;) {
            var f = e[d];
            ++d;
            var g = f + c,
                i = z.field(b, g);
            if (null != i) return {
                prefix: f,
                field: g,
                value: i
            }
        }
        return {
            prefix: null,
            field: null,
            value: null
        }
    };
    n.loadFirstExtension = function (a, b) {
        for (var c = 0; c < a.length;) {
            var d = a[c];
            ++c;
            d = n.loadExtension(d, b);
            if (null != d.field) return d
        }
        return {
            prefix: null,
            field: null,
            value: null
        }
    };
    n.polyfill = function (a, b) {
        null == b && (b = window);
        var c = n.loadExtension(a, b).value;
        if (null == c) return !1;
        b[a] = c;
        return !0
    };
    n.setVendorStyle = function (a, b, c) {
        for (var a = a.style, d = 0, e = n.VENDOR_PREFIXES; d < e.length;) {
            var f = e[d];
            ++d;
            a.setProperty("-" + f + "-" + b, c)
        }
        a.setProperty(b, c)
    };
    n.addVendorListener =
        function (a, b, c, d) {
            for (var e = 0, f = n.VENDOR_PREFIXES; e < f.length;) {
                var g = f[e];
                ++e;
                a.addEventListener(g + b, c, d)
            }
            a.addEventListener(b, c, d)
    };
    n.orientation = function (a) {
        switch (a) {
        case -90:
        case 90:
            return ea.Landscape;
        default:
            return ea.Portrait
        }
    };
    n.createEmptyCanvas = function (a, b) {
        var c;
        c = window.document.createElement("canvas");
        c.width = a;
        c.height = b;
        return c
    };
    n.createCanvas = function (a) {
        var b = n.createEmptyCanvas(a.width, a.height),
            c = b.getContext("2d");
        c.save();
        c.globalCompositeOperation = "copy";
        c.drawImage(a, 0, 0);
        c.restore();
        return b
    };
    n.fixAndroidMath = function () {
        if (0 <= window.navigator.userAgent.indexOf("Linux; U; Android 4")) {
            var a = Math.sin,
                b = Math.cos;
            Math.sin = function (b) {
                return 0 == b ? 0 : a(b)
            };
            Math.cos = function (a) {
                return 0 == a ? 1 : b(a)
            }
        }
    };
    var Ub = function () {};
    f["flambe.subsystem.WebSystem"] = Ub;
    Ub.__name__ = ["flambe", "subsystem", "WebSystem"];
    Ub.prototype = {
        __class__: Ub
    };
    var bb = function (a) {
        this._container = a
    };
    f["flambe.platform.html.HtmlWeb"] = bb;
    bb.__name__ = ["flambe", "platform", "html", "HtmlWeb"];
    bb.__interfaces__ = [Ub];
    bb.prototype = {
        openBrowser: function (a) {
            window.open(a, "_blank")
        },
        __class__: bb
    };
    var u = function (a) {
        this._disposed = !1;
        this.buffer = a
    };
    f["flambe.platform.html.WebAudioSound"] = u;
    u.__name__ = ["flambe", "platform", "html", "WebAudioSound"];
    u.__interfaces__ = [Ea];
    u.__properties__ = {
        get_supported: "get_supported"
    };
    u.get_supported = function () {
        if (u._detectSupport) {
            u._detectSupport = !1;
            var a = n.loadExtension("AudioContext").value;
            null != a && (u.ctx = new a, u.gain = u.createGain(), u.gain.connect(u.ctx.destination), l.volume.watch(function (a) {
                u.gain.gain.value =
                    a
            }))
        }
        return null != u.ctx
    };
    u.createGain = function () {
        return null != u.ctx.createGain ? u.ctx.createGain() : u.ctx.createGainNode()
    };
    u.start = function (a, b) {
        null != a.start ? a.start(b) : a.noteOn(b)
    };
    u.__super__ = N;
    u.prototype = v(N.prototype, {
        play: function (a) {
            null == a && (a = 1);
            return new Ra(this, a, !1)
        },
        loop: function (a) {
            null == a && (a = 1);
            return new Ra(this, a, !0)
        },
        get_duration: function () {
            return this.buffer.duration
        },
        onDisposed: function () {
            this.buffer = null
        },
        __class__: u,
        __properties__: {
            get_duration: "get_duration"
        }
    });
    var Ra = function (a,
        b, c) {
        var d = this;
        this._sound = a;
        this._head = u.gain;
        this._complete = new M(!1);
        this._sourceNode = u.ctx.createBufferSource();
        this._sourceNode.buffer = a.buffer;
        this._sourceNode.loop = c;
        this._sourceNode.onended = function () {
            d._complete.set__(!0)
        };
        u.start(this._sourceNode, 0);
        this.playAudio();
        this.volume = new A(b, function (a) {
            d.setVolume(a)
        });
        1 != b && this.setVolume(b);
        l.hidden._value && this.set_paused(!0)
    };
    f["flambe.platform.html._WebAudioSound.WebAudioPlayback"] = Ra;
    Ra.__name__ = ["flambe", "platform", "html", "_WebAudioSound",
        "WebAudioPlayback"
    ];
    Ra.__interfaces__ = [tb, Fa];
    Ra.prototype = {
        get_sound: function () {
            return this._sound
        },
        set_paused: function (a) {
            a != 0 <= this._pausedAt && (a ? (this._sourceNode.disconnect(), this._pausedAt = this.get_position()) : this.playAudio());
            return a
        },
        get_position: function () {
            return this._complete._value ? this._sound.get_duration() : 0 <= this._pausedAt ? this._pausedAt : (u.ctx.currentTime - this._startedAt) % this._sound.get_duration()
        },
        update: function (a) {
            this.volume.update(a);
            3 == this._sourceNode.playbackState && this._complete.set__(!0);
            return this._complete._value || 0 <= this._pausedAt ? (this._tickableAdded = !1, this._hideBinding.dispose(), !0) : !1
        },
        dispose: function () {
            this.set_paused(!0);
            this._complete.set__(!0)
        },
        setVolume: function (a) {
            null == this._gainNode && (this._gainNode = u.createGain(), this.insertNode(this._gainNode));
            this._gainNode.gain.value = a
        },
        insertNode: function (a) {
            0 <= this._pausedAt || (this._sourceNode.disconnect(), this._sourceNode.connect(a));
            a.connect(this._head);
            this._head = a
        },
        playAudio: function () {
            var a = this;
            this._sourceNode.connect(this._head);
            this._startedAt = u.ctx.currentTime;
            this._pausedAt = -1;
            this._tickableAdded || (oa.instance.mainLoop.addTickable(this), this._tickableAdded = !0, this._hideBinding = l.hidden.get_changed().connect(function (b) {
                b ? (a._wasPaused = 0 <= a._pausedAt, a.set_paused(!0)) : a.set_paused(a._wasPaused)
            }))
        },
        __class__: Ra,
        __properties__: {
            get_position: "get_position",
            get_sound: "get_sound",
            set_paused: "set_paused"
        }
    };
    var wb = function () {
        this._width = this._height = -1;
        this._transitor = null;
        this.scenes = [];
        this.occludedScenes = [];
        this._root = new G
    };
    f["flambe.scene.Director"] = wb;
    wb.__name__ = ["flambe", "scene", "Director"];
    wb.__super__ = C;
    wb.prototype = v(C.prototype, {
        get_name: function () {
            return "Director_5"
        },
        setSize: function (a, b) {
            this._width = a;
            this._height = b;
            return this
        },
        pushScene: function (a, b) {
            var c = this;
            this.completeTransition();
            var d = this.get_topScene();
            null != d ? this.playTransition(d, a, b, function () {
                c.hide(d)
            }) : (this.add(a), this.invalidateVisibility())
        },
        popScene: function (a) {
            var b = this;
            this.completeTransition();
            var c = this.get_topScene();
            if (null != c) {
                this.scenes.pop();
                var d = this.get_topScene();
                null != d ? this.playTransition(c, d, a, function () {
                    b.hideAndDispose(c)
                }) : (this.hideAndDispose(c), this.invalidateVisibility())
            }
        },
        unwindToScene: function (a, b) {
            var c = this;
            this.completeTransition();
            var d = this.get_topScene();
            if (null != d) {
                if (d != a) {
                    for (this.scenes.pop(); 0 < this.scenes.length && this.scenes[this.scenes.length - 1] != a;) this.scenes.pop().dispose();
                    this.playTransition(d, a, b, function () {
                        c.hideAndDispose(d)
                    })
                }
            } else this.pushScene(a, b)
        },
        onAdded: function () {
            this.owner.addChild(this._root)
        },
        onRemoved: function () {
            this.completeTransition();
            for (var a = 0, b = this.scenes; a < b.length;) {
                var c = b[a];
                ++a;
                c.dispose()
            }
            this.scenes = [];
            this.occludedScenes = [];
            this._root.dispose()
        },
        onUpdate: function (a) {
            null != this._transitor && this._transitor.update(a) && this.completeTransition()
        },
        get_topScene: function () {
            var a = this.scenes.length;
            return 0 < a ? this.scenes[a - 1] : null
        },
        add: function (a) {
            var b = this.get_topScene();
            null != b && this._root.removeChild(b);
            s.remove(this.scenes, a);
            this.scenes.push(a);
            this._root.addChild(a)
        },
        hide: function (a) {
            a =
                a._compMap.Scene_4;
            null != a && a.hidden.emit()
        },
        hideAndDispose: function (a) {
            this.hide(a);
            a.dispose()
        },
        show: function (a) {
            a = a._compMap.Scene_4;
            null != a && a.shown.emit()
        },
        invalidateVisibility: function () {
            for (var a = this.scenes.length; 0 < a;) {
                var b = this.scenes[--a]._compMap.Scene_4;
                if (null == b || b.opaque) break
            }
            this.occludedScenes = 0 < this.scenes.length ? this.scenes.slice(a, this.scenes.length - 1) : [];
            a = this.get_topScene();
            null != a && this.show(a)
        },
        completeTransition: function () {
            null != this._transitor && (this._transitor.complete(),
                this._transitor = null, this.invalidateVisibility())
        },
        playTransition: function (a, b, c, d) {
            this.completeTransition();
            this.add(b);
            null != c ? (this.occludedScenes.push(a), this._transitor = new Vb(a, b, c, d), this._transitor.init(this)) : (d(), this.invalidateVisibility())
        },
        get_width: function () {
            return 0 > this._width ? l._platform.getStage().get_width() : this._width
        },
        get_height: function () {
            return 0 > this._height ? l._platform.getStage().get_height() : this._height
        },
        __class__: wb,
        __properties__: v(C.prototype.__properties__, {
            get_height: "get_height",
            get_width: "get_width",
            get_topScene: "get_topScene"
        })
    });
    var Vb = function (a, b, c, d) {
        this._from = a;
        this._to = b;
        this._transition = c;
        this._onComplete = d
    };
    f["flambe.scene._Director.Transitor"] = Vb;
    Vb.__name__ = ["flambe", "scene", "_Director", "Transitor"];
    Vb.prototype = {
        init: function (a) {
            this._transition.init(a, this._from, this._to)
        },
        update: function (a) {
            return this._transition.update(a)
        },
        complete: function () {
            this._transition.complete();
            this._onComplete()
        },
        __class__: Vb
    };
    var Sa = function () {};
    f["flambe.scene.Transition"] = Sa;
    Sa.__name__ = ["flambe", "scene", "Transition"];
    Sa.prototype = {
        init: function (a, b, c) {
            this._director = a;
            this._from = b;
            this._to = c
        },
        update: function () {
            return !0
        },
        complete: function () {},
        __class__: Sa
    };
    var W = function (a, b) {
        this._duration = a;
        this._ease = null != b ? b : m.linear
    };
    f["flambe.scene.TweenTransition"] = W;
    W.__name__ = ["flambe", "scene", "TweenTransition"];
    W.__super__ = Sa;
    W.prototype = v(Sa.prototype, {
        init: function (a, b, c) {
            Sa.prototype.init.call(this, a, b, c);
            this._elapsed = 0
        },
        update: function (a) {
            this._elapsed += a;
            return this._elapsed >=
                this._duration
        },
        interp: function (a, b) {
            return a + (b - a) * this._ease(this._elapsed / this._duration)
        },
        __class__: W
    });
    var qa = function (a, b) {
        W.call(this, a, b)
    };
    f["flambe.scene.FadeTransition"] = qa;
    qa.__name__ = ["flambe", "scene", "FadeTransition"];
    qa.__super__ = W;
    qa.prototype = v(W.prototype, {
        init: function (a, b, c) {
            W.prototype.init.call(this, a, b, c);
            a = this._to._compMap.Sprite_0;
            null == a && this._to.add(a = new r);
            a.alpha.set__(0)
        },
        update: function (a) {
            a = W.prototype.update.call(this, a);
            this._to._compMap.Sprite_0.alpha.set__(this.interp(0,
                1));
            return a
        },
        complete: function () {
            this._to._compMap.Sprite_0.alpha.set__(1)
        },
        __class__: qa
    });
    var ja = function (a) {
        null == a && (a = !0);
        this.opaque = a;
        this.shown = new pa;
        this.hidden = new pa
    };
    f["flambe.scene.Scene"] = ja;
    ja.__name__ = ["flambe", "scene", "Scene"];
    ja.__super__ = C;
    ja.prototype = v(C.prototype, {
        get_name: function () {
            return "Scene_4"
        },
        __class__: ja
    });
    var xb = function (a, b) {
        this._direction = 2;
        W.call(this, a, b)
    };
    f["flambe.scene.SlideTransition"] = xb;
    xb.__name__ = ["flambe", "scene", "SlideTransition"];
    xb.__super__ = W;
    xb.prototype =
        v(W.prototype, {
            left: function () {
                this._direction = 2;
                return this
            },
            init: function (a, b, c) {
                W.prototype.init.call(this, a, b, c);
                switch (this._direction) {
                case 0:
                    this._x = 0;
                    this._y = -this._director.get_height();
                    break;
                case 1:
                    this._x = 0;
                    this._y = this._director.get_height();
                    break;
                case 2:
                    this._x = -this._director.get_width();
                    this._y = 0;
                    break;
                case 3:
                    this._x = this._director.get_width(), this._y = 0
                }
                a = this._from._compMap.Sprite_0;
                null == a && this._from.add(a = new r);
                a.setXY(0, 0);
                a = this._to._compMap.Sprite_0;
                null == a && this._to.add(a =
                    new r);
                a.setXY(-this._x, -this._y)
            },
            update: function (a) {
                a = W.prototype.update.call(this, a);
                this._from._compMap.Sprite_0.setXY(this.interp(0, this._x), this.interp(0, this._y));
                this._to._compMap.Sprite_0.setXY(this.interp(-this._x, 0), this.interp(-this._y, 0));
                return a
            },
            complete: function () {
                this._from._compMap.Sprite_0.setXY(0, 0);
                this._to._compMap.Sprite_0.setXY(0, 0)
            },
            __class__: xb
        });
    var ka = function () {};
    f["flambe.script.Action"] = ka;
    ka.__name__ = ["flambe", "script", "Action"];
    ka.prototype = {
        __class__: ka
    };
    var yb =
        function (a, b, c, d) {
            this._value = a;
            this._to = b;
            this._seconds = c;
            this._easing = d
    };
    f["flambe.script.AnimateTo"] = yb;
    yb.__name__ = ["flambe", "script", "AnimateTo"];
    yb.__interfaces__ = [ka];
    yb.prototype = {
        update: function (a) {
            null == this._tween && (this._tween = new La(this._value._value, this._to, this._seconds, this._easing), this._value.set_behavior(this._tween), this._value.update(a));
            if (this._value._behavior != this._tween) {
                var b = this._tween.elapsed - this._seconds;
                this._tween = null;
                return 0 < b ? a - b : 0
            }
            return -1
        },
        __class__: yb
    };
    var Q =
        function (a) {
            this._fn = a
    };
    f["flambe.script.CallFunction"] = Q;
    Q.__name__ = ["flambe", "script", "CallFunction"];
    Q.__interfaces__ = [ka];
    Q.prototype = {
        update: function () {
            this._fn();
            return 0
        },
        __class__: Q
    };
    var $ = function (a) {
        this._duration = a;
        this._elapsed = 0
    };
    f["flambe.script.Delay"] = $;
    $.__name__ = ["flambe", "script", "Delay"];
    $.__interfaces__ = [ka];
    $.prototype = {
        update: function (a) {
            this._elapsed += a;
            if (this._elapsed >= this._duration) {
                var b = this._elapsed - this._duration;
                this._elapsed = 0;
                return a - b
            }
            return -1
        },
        __class__: $
    };
    var zb =
        function (a) {
            this._completedActions = [];
            this._runningActions = null != a ? a.slice() : []
    };
    f["flambe.script.Parallel"] = zb;
    zb.__name__ = ["flambe", "script", "Parallel"];
    zb.__interfaces__ = [ka];
    zb.prototype = {
        update: function (a, b) {
            for (var c = !0, d = 0, e = 0, f = this._runningActions.length; e < f;) {
                var g = e++,
                    i = this._runningActions[g];
                if (null != i) {
                    var k = i.update(a, b);
                    0 <= k ? (this._runningActions[g] = null, this._completedActions.push(i), k > d && (d = k)) : c = !1
                }
            }
            return c ? (this._runningActions = this._completedActions, this._completedActions = [],
                d) : -1
        },
        __class__: zb
    };
    var Ab = function (a, b) {
        null == b && (b = -1);
        this._action = a;
        this._remaining = this._count = b
    };
    f["flambe.script.Repeat"] = Ab;
    Ab.__name__ = ["flambe", "script", "Repeat"];
    Ab.__interfaces__ = [ka];
    Ab.prototype = {
        update: function (a, b) {
            if (0 == this._count) return 0;
            var c = this._action.update(a, b);
            return 0 < this._count && 0 <= c && 0 == --this._remaining ? (this._remaining = this._count, c) : -1
        },
        __class__: Ab
    };
    var ga = function () {
        this.stopAll()
    };
    f["flambe.script.Script"] = ga;
    ga.__name__ = ["flambe", "script", "Script"];
    ga.__super__ =
        C;
    ga.prototype = v(C.prototype, {
        get_name: function () {
            return "Script_3"
        },
        run: function (a) {
            a = new Bb(a);
            this._handles.push(a);
            return a
        },
        stopAll: function () {
            this._handles = []
        },
        onUpdate: function (a) {
            for (var b = 0; b < this._handles.length;) {
                var c = this._handles[b];
                c.removed || 0 <= c.action.update(a, this.owner) ? this._handles.splice(b, 1) : ++b
            }
        },
        __class__: ga
    });
    var Bb = function (a) {
        this.removed = !1;
        this.action = a
    };
    f["flambe.script._Script.Handle"] = Bb;
    Bb.__name__ = ["flambe", "script", "_Script", "Handle"];
    Bb.__interfaces__ = [da];
    Bb.prototype = {
        dispose: function () {
            this.removed = !0;
            this.action = null
        },
        __class__: Bb
    };
    var ha = function (a) {
        this._idx = 0;
        this._runningActions = null != a ? a.slice() : []
    };
    f["flambe.script.Sequence"] = ha;
    ha.__name__ = ["flambe", "script", "Sequence"];
    ha.__interfaces__ = [ka];
    ha.prototype = {
        add: function (a) {
            this._runningActions.push(a)
        },
        update: function (a, b) {
            for (var c = 0;;) {
                var d = this._runningActions[this._idx];
                if (null != d)
                    if (d = d.update(a - c, b), 0 <= d) c += d;
                    else return -1;
                    ++this._idx;
                if (this._idx >= this._runningActions.length) {
                    this._idx = 0;
                    break
                } else if (c >
                    a) return -1
            }
            return c
        },
        __class__: ha
    };
    var Ha = function (a, b, c) {
        this._strengthX = a;
        this._strengthY = b;
        this._duration = c;
        this._elapsed = 0
    };
    f["flambe.script.Shake"] = Ha;
    Ha.__name__ = ["flambe", "script", "Shake"];
    Ha.__interfaces__ = [ka];
    Ha.prototype = {
        update: function (a, b) {
            var c = b._compMap.Sprite_0;
            null == this._jitterX && (this._jitterX = new ra(c.x._value, this._strengthX), this._jitterY = new ra(c.y._value, this._strengthY), c.x.set_behavior(this._jitterX), c.y.set_behavior(this._jitterY));
            this._elapsed += a;
            if (this._elapsed >= this._duration) {
                var d =
                    this._elapsed - this._duration;
                c.x._behavior == this._jitterX && c.x.set__(this._jitterX.base);
                c.y._behavior == this._jitterY && c.y.set__(this._jitterY.base);
                this._jitterY = this._jitterX = null;
                this._elapsed = 0;
                return a - d
            }
            return -1
        },
        __class__: Ha
    };
    var ca = f["flambe.subsystem.RendererType"] = {
        __ename__: ["flambe", "subsystem", "RendererType"],
        __constructs__: ["Stage3D", "WebGL", "Canvas"]
    };
    ca.Stage3D = ["Stage3D", 0];
    ca.Stage3D.toString = q;
    ca.Stage3D.__enum__ = ca;
    ca.WebGL = ["WebGL", 1];
    ca.WebGL.toString = q;
    ca.WebGL.__enum__ = ca;
    ca.Canvas = ["Canvas", 2];
    ca.Canvas.toString = q;
    ca.Canvas.__enum__ = ca;
    var cc = function () {};
    f["flambe.util.Assert"] = cc;
    cc.__name__ = ["flambe", "util", "Assert"];
    cc.that = function () {};
    var dc = function () {};
    f["flambe.util.BitSets"] = dc;
    dc.__name__ = ["flambe", "util", "BitSets"];
    dc.set = function (a, b, c) {
        return c ? a | b : a & ~b
    };
    var Ta = function () {
        this.mainSection = new O;
        this.sections = new O
    };
    f["flambe.util.Config"] = Ta;
    Ta.__name__ = ["flambe", "util", "Config"];
    Ta.parse = function (a) {
        for (var b = new Ta, c = new X("^\\s*;", ""), d = new X("^\\s*\\[\\s*([^\\]]*)\\s*\\]",
                ""), e = new X("^\\s*([\\w\\.\\-_]+)\\s*=\\s*(.*)", ""), f = b.mainSection, g = 0, a = (new X("\r\n|\r|\n", "g")).split(a); g < a.length;) {
            var i = a[g];
            ++g;
            if (!c.match(i))
                if (d.match(i)) i = d.matched(1), b.sections.exists(i) ? f = b.sections.get(i) : (f = new O, b.sections.set(i, f));
                else if (e.match(i)) {
                var i = e.matched(1),
                    k = e.matched(2),
                    l = k.charCodeAt(0);
                if ((34 == l || 39 == l) && k.charCodeAt(k.length - 1) == l) k = s.substr(k, 1, k.length - 2);
                k = E.replace(E.replace(E.replace(E.replace(E.replace(E.replace(k, "\\n", "\n"), "\\r", "\r"), "\\t", "\t"), "\\'",
                    "'"), '\\"', '"'), "\\\\", "\\");
                f.set(i, k)
            }
        }
        return b
    };
    Ta.prototype = {
        get: function (a) {
            var b = a.indexOf(".");
            if (0 > b) return this.mainSection.get(a);
            var c;
            c = this.sections.get(s.substr(a, 0, b));
            return null != c ? (a = s.substr(a, b + 1, null), c.get(a)) : null
        },
        __class__: Ta
    };
    var Ua = function (a) {
        this.config = a;
        this.missingTranslation = new B
    };
    f["flambe.util.MessageBundle"] = Ua;
    Ua.__name__ = ["flambe", "util", "MessageBundle"];
    Ua.parse = function (a) {
        return new Ua(Ta.parse(a))
    };
    Ua.prototype = {
        get: function (a, b) {
            var c = this.config.get(a);
            return null == c ? (this.missingTranslation.emit(a), a) : null != b ? I.substitute(c, b) : c
        },
        __class__: Ua
    };
    var nb = function () {
        this.success = new B;
        this.error = new B;
        this.progressChanged = new pa;
        this.hasResult = !1;
        this._total = this._progress = 0
    };
    f["flambe.util.Promise"] = nb;
    nb.__name__ = ["flambe", "util", "Promise"];
    nb.prototype = {
        set_result: function (a) {
            if (this.hasResult) throw "Promise result already assigned";
            this._result = a;
            this.hasResult = !0;
            this.success.emit(a);
            return a
        },
        get: function (a) {
            return this.hasResult ? (a(this._result),
                null) : this.success.connect(a).once()
        },
        set_progress: function (a) {
            this._progress != a && (this._progress = a, this.progressChanged.emit());
            return a
        },
        set_total: function (a) {
            this._total != a && (this._total = a, this.progressChanged.emit());
            return a
        },
        __class__: nb,
        __properties__: {
            set_total: "set_total",
            set_progress: "set_progress",
            set_result: "set_result"
        }
    };
    var pa = function (a) {
        H.call(this, a)
    };
    f["flambe.util.Signal0"] = pa;
    pa.__name__ = ["flambe", "util", "Signal0"];
    pa.__super__ = H;
    pa.prototype = v(H.prototype, {
        connect: function (a,
            b) {
            null == b && (b = !1);
            return this.connectImpl(a, b)
        },
        emit: function () {
            var a = this;
            this._head == H.DISPATCHING_SENTINEL ? this.defer(function () {
                a.emitImpl()
            }) : this.emitImpl()
        },
        emitImpl: function () {
            for (var a = this.willEmit(), b = a; null != b;) b._listener(), b.stayInList || b.dispose(), b = b._next;
            this.didEmit(a)
        },
        __class__: pa
    });
    var Fb = function (a) {
        this.next = null;
        this.fn = a
    };
    f["flambe.util._SignalBase.Task"] = Fb;
    Fb.__name__ = ["flambe", "util", "_SignalBase", "Task"];
    Fb.prototype = {
        __class__: Fb
    };
    var I = function () {};
    f["flambe.util.Strings"] =
        I;
    I.__name__ = ["flambe", "util", "Strings"];
    I.getFileExtension = function (a) {
        var b = a.lastIndexOf(".");
        return 0 < b ? s.substr(a, b + 1, null) : null
    };
    I.removeFileExtension = function (a) {
        var b = a.lastIndexOf(".");
        return 0 < b ? s.substr(a, 0, b) : a
    };
    I.getUrlExtension = function (a) {
        var b = a.lastIndexOf("?");
        0 <= b && (a = s.substr(a, 0, b));
        b = a.lastIndexOf("/");
        0 <= b && (a = s.substr(a, b + 1, null));
        return I.getFileExtension(a)
    };
    I.joinPath = function (a, b) {
        0 < a.length && 47 != a.charCodeAt(a.length - 1) && (a += "/");
        return a + b
    };
    I.substitute = function (a, b) {
        for (var c =
            0, d = b.length; c < d;) var e = c++,
        a = E.replace(a, "{" + e + "}", b[e]);
        return a
    };
    I.withFields = function (a, b) {
        var c = b.length;
        if (0 < c) {
            for (var a = 0 < a.length ? a + " [" : a + "[", d = 0; d < c;) {
                0 < d && (a += ", ");
                var e = b[d],
                    f = b[d + 1];
                if (y.is(f, Error)) {
                    var g = f.stack;
                    null != g && (f = g)
                }
                a += e + "=" + y.string(f);
                d += 2
            }
            a += "]"
        }
        return a
    };
    var ia = function () {
        this.buf = new Wa;
        this.cache = [];
        this.useCache = ia.USE_CACHE;
        this.useEnumIndex = ia.USE_ENUM_INDEX;
        this.shash = new O;
        this.scount = 0
    };
    f["haxe.Serializer"] = ia;
    ia.__name__ = ["haxe", "Serializer"];
    ia.prototype = {
        toString: function () {
            return this.buf.b
        },
        serializeString: function (a) {
            var b = this.shash.get(a);
            null != b ? (this.buf.b += "R", this.buf.b = null == b ? this.buf.b + "null" : this.buf.b + ("" + b)) : (this.shash.set(a, this.scount++), this.buf.b += "y", a = encodeURIComponent(a), this.buf.b = null == a.length ? this.buf.b + "null" : this.buf.b + ("" + a.length), this.buf.b += ":", this.buf.b = null == a ? this.buf.b + "null" : this.buf.b + ("" + a))
        },
        serializeRef: function (a) {
            for (var b = typeof a, c = 0, d = this.cache.length; c < d;) {
                var e = c++,
                    f = this.cache[e];
                if (typeof f ==
                    b && f == a) return this.buf.b += "r", this.buf.b = null == e ? this.buf.b + "null" : this.buf.b + ("" + e), !0
            }
            this.cache.push(a);
            return !1
        },
        serializeFields: function (a) {
            for (var b = 0, c = z.fields(a); b < c.length;) {
                var d = c[b];
                ++b;
                this.serializeString(d);
                this.serialize(z.field(a, d))
            }
            this.buf.b += "g"
        },
        serialize: function (a) {
            var b = F["typeof"](a);
            switch (b[1]) {
            case 0:
                this.buf.b += "n";
                break;
            case 1:
                if (0 == a) {
                    this.buf.b += "z";
                    break
                }
                this.buf.b += "i";
                this.buf.b = null == a ? this.buf.b + "null" : this.buf.b + ("" + a);
                break;
            case 2:
                Math.isNaN(a) ? this.buf.b +=
                    "k" : Math.isFinite(a) ? (this.buf.b += "d", this.buf.b = null == a ? this.buf.b + "null" : this.buf.b + ("" + a)) : this.buf.b = 0 > a ? this.buf.b + "m" : this.buf.b + "p";
                break;
            case 3:
                this.buf.b = a ? this.buf.b + "t" : this.buf.b + "f";
                break;
            case 6:
                b = b[2];
                if (b == String) {
                    this.serializeString(a);
                    break
                }
                if (this.useCache && this.serializeRef(a)) break;
                switch (b) {
                case Array:
                    b = 0;
                    this.buf.b += "a";
                    for (var c = a.length, d = 0; d < c;) {
                        var e = d++;
                        null == a[e] ? b++ : (0 < b && (1 == b ? this.buf.b += "n" : (this.buf.b += "u", this.buf.b = null == b ? this.buf.b + "null" : this.buf.b + ("" + b)), b =
                            0), this.serialize(a[e]))
                    }
                    0 < b && (1 == b ? this.buf.b += "n" : (this.buf.b += "u", this.buf.b = null == b ? this.buf.b + "null" : this.buf.b + ("" + b)));
                    this.buf.b += "h";
                    break;
                case Va:
                    this.buf.b += "l";
                    for (a = a.iterator(); a.hasNext();) this.serialize(a.next());
                    this.buf.b += "h";
                    break;
                case Date:
                    this.buf.b += "v";
                    this.buf.add(s.dateStr(a));
                    break;
                case O:
                    this.buf.b += "b";
                    for (b = a.keys(); b.hasNext();) c = b.next(), this.serializeString(c), this.serialize(a.get(c));
                    this.buf.b += "h";
                    break;
                case aa:
                    this.buf.b += "q";
                    for (b = a.keys(); b.hasNext();) c = b.next(),
                    this.buf.b += ":", this.buf.b = null == c ? this.buf.b + "null" : this.buf.b + ("" + c), this.serialize(a.get(c));
                    this.buf.b += "h";
                    break;
                case xa:
                    this.buf.b += "M";
                    for (b = a.keys(); b.hasNext();) c = b.next(), d = z.field(c, "__id__"), z.deleteField(c, "__id__"), this.serialize(c), c.__id__ = d, this.serialize(a.h[c.__id__]);
                    this.buf.b += "h";
                    break;
                case Ga:
                    d = 0;
                    e = a.length - 2;
                    b = new Wa;
                    for (c = ia.BASE64; d < e;) {
                        var f = a.get(d++),
                            g = a.get(d++),
                            i = a.get(d++);
                        b.add(c.charAt(f >> 2));
                        b.add(c.charAt((f << 4 | g >> 4) & 63));
                        b.add(c.charAt((g << 2 | i >> 6) & 63));
                        b.add(c.charAt(i &
                            63))
                    }
                    d == e ? (e = a.get(d++), a = a.get(d++), b.add(c.charAt(e >> 2)), b.add(c.charAt((e << 4 | a >> 4) & 63)), b.add(c.charAt(a << 2 & 63))) : d == e + 1 && (a = a.get(d++), b.add(c.charAt(a >> 2)), b.add(c.charAt(a << 4 & 63)));
                    a = b.b;
                    this.buf.b += "s";
                    this.buf.b = null == a.length ? this.buf.b + "null" : this.buf.b + ("" + a.length);
                    this.buf.b += ":";
                    this.buf.b = null == a ? this.buf.b + "null" : this.buf.b + ("" + a);
                    break;
                default:
                    this.useCache && this.cache.pop(), null != a.hxSerialize ? (this.buf.b += "C", this.serializeString(F.getClassName(b)), this.useCache && this.cache.push(a),
                        a.hxSerialize(this), this.buf.b += "g") : (this.buf.b += "c", this.serializeString(F.getClassName(b)), this.useCache && this.cache.push(a), this.serializeFields(a))
                }
                break;
            case 4:
                if (this.useCache && this.serializeRef(a)) break;
                this.buf.b += "o";
                this.serializeFields(a);
                break;
            case 7:
                b = b[2];
                if (this.useCache) {
                    if (this.serializeRef(a)) break;
                    this.cache.pop()
                }
                this.buf.b = this.useEnumIndex ? this.buf.b + "j" : this.buf.b + "w";
                this.serializeString(F.getEnumName(b));
                this.useEnumIndex ? (this.buf.b += ":", this.buf.b += y.string(a[1])) : this.serializeString(a[0]);
                this.buf.b += ":";
                b = a.length;
                this.buf.b += y.string(b - 2);
                for (c = 2; c < b;) d = c++, this.serialize(a[d]);
                this.useCache && this.cache.push(a);
                break;
            case 5:
                throw "Cannot serialize function";
            default:
                throw "Cannot serialize " + y.string(a);
            }
        },
        __class__: ia
    };
    var P = function (a) {
        this.buf = a;
        this.length = a.length;
        this.pos = 0;
        this.scache = [];
        this.cache = [];
        a = P.DEFAULT_RESOLVER;
        null == a && (a = F, P.DEFAULT_RESOLVER = a);
        this.setResolver(a)
    };
    f["haxe.Unserializer"] = P;
    P.__name__ = ["haxe", "Unserializer"];
    P.initCodes = function () {
        for (var a = [], b =
                0, c = P.BASE64.length; b < c;) {
            var d = b++;
            a[P.BASE64.charCodeAt(d)] = d
        }
        return a
    };
    P.run = function (a) {
        return (new P(a)).unserialize()
    };
    P.prototype = {
        setResolver: function (a) {
            this.resolver = null == a ? {
                resolveClass: function () {
                    return null
                },
                resolveEnum: function () {
                    return null
                }
            } : a
        },
        get: function (a) {
            return this.buf.charCodeAt(a)
        },
        readDigits: function () {
            for (var a = 0, b = !1, c = this.pos;;) {
                var d = this.buf.charCodeAt(this.pos);
                if (d != d) break;
                if (45 == d) {
                    if (this.pos != c) break;
                    b = !0
                } else {
                    if (48 > d || 57 < d) break;
                    a = 10 * a + (d - 48)
                }
                this.pos++
            }
            b && (a *= -1);
            return a
        },
        unserializeObject: function (a) {
            for (;;) {
                if (this.pos >= this.length) throw "Invalid object";
                if (103 == this.buf.charCodeAt(this.pos)) break;
                var b = this.unserialize();
                if ("string" != typeof b) throw "Invalid object key";
                var c = this.unserialize();
                a[b] = c
            }
            this.pos++
        },
        unserializeEnum: function (a, b) {
            if (58 != this.get(this.pos++)) throw "Invalid enum format";
            var c = this.readDigits();
            if (0 == c) return F.createEnum(a, b);
            for (var d = []; 0 < c--;) d.push(this.unserialize());
            return F.createEnum(a, b, d)
        },
        unserialize: function () {
            switch (this.get(this.pos++)) {
            case 110:
                return null;
            case 116:
                return !0;
            case 102:
                return !1;
            case 122:
                return 0;
            case 105:
                return this.readDigits();
            case 100:
                for (var a = this.pos;;) {
                    var b = this.buf.charCodeAt(this.pos);
                    if (43 <= b && 58 > b || 101 == b || 69 == b) this.pos++;
                    else break
                }
                return y.parseFloat(s.substr(this.buf, a, this.pos - a));
            case 121:
                a = this.readDigits();
                if (58 != this.get(this.pos++) || this.length - this.pos < a) throw "Invalid string length";
                b = s.substr(this.buf, this.pos, a);
                this.pos += a;
                b = decodeURIComponent(b.split("+").join(" "));
                this.scache.push(b);
                return b;
            case 107:
                return Math.NaN;
            case 109:
                return Math.NEGATIVE_INFINITY;
            case 112:
                return Math.POSITIVE_INFINITY;
            case 97:
                a = [];
                for (this.cache.push(a);;) {
                    b = this.buf.charCodeAt(this.pos);
                    if (104 == b) {
                        this.pos++;
                        break
                    }
                    117 == b ? (this.pos++, b = this.readDigits(), a[a.length + b - 1] = null) : a.push(this.unserialize())
                }
                return a;
            case 111:
                return a = {}, this.cache.push(a), this.unserializeObject(a), a;
            case 114:
                a = this.readDigits();
                if (0 > a || a >= this.cache.length) throw "Invalid reference";
                return this.cache[a];
            case 82:
                a = this.readDigits();
                if (0 > a || a >= this.scache.length) throw "Invalid string reference";
                return this.scache[a];
            case 120:
                throw this.unserialize();
            case 99:
                a = this.unserialize();
                b = this.resolver.resolveClass(a);
                if (null == b) throw "Class not found " + a;
                a = F.createEmptyInstance(b);
                this.cache.push(a);
                this.unserializeObject(a);
                return a;
            case 119:
                a = this.unserialize();
                b = this.resolver.resolveEnum(a);
                if (null == b) throw "Enum not found " + a;
                a = this.unserializeEnum(b, this.unserialize());
                this.cache.push(a);
                return a;
            case 106:
                a = this.unserialize();
                b = this.resolver.resolveEnum(a);
                if (null == b) throw "Enum not found " + a;
                this.pos++;
                var c = this.readDigits(),
                    d = F.getEnumConstructs(b)[c];
                if (null == d) throw "Unknown enum index " + a + "@" + c;
                a = this.unserializeEnum(b, d);
                this.cache.push(a);
                return a;
            case 108:
                a = new Va;
                for (this.cache.push(a); 104 != this.buf.charCodeAt(this.pos);) a.add(this.unserialize());
                this.pos++;
                return a;
            case 98:
                a = new O;
                for (this.cache.push(a); 104 != this.buf.charCodeAt(this.pos);) b = this.unserialize(), a.set(b, this.unserialize());
                this.pos++;
                return a;
            case 113:
                a = new aa;
                this.cache.push(a);
                for (b = this.get(this.pos++); 58 == b;) b =
                    this.readDigits(), a.set(b, this.unserialize()), b = this.get(this.pos++);
                if (104 != b) throw "Invalid IntMap format";
                return a;
            case 77:
                a = new xa;
                for (this.cache.push(a); 104 != this.buf.charCodeAt(this.pos);) b = this.unserialize(), a.set(b, this.unserialize());
                this.pos++;
                return a;
            case 118:
                return a = s.substr(this.buf, this.pos, 19), a = s.strDate(a), this.cache.push(a), this.pos += 19, a;
            case 115:
                a = this.readDigits();
                d = this.buf;
                if (58 != this.get(this.pos++) || this.length - this.pos < a) throw "Invalid bytes length";
                var e = P.CODES;
                null == e &&
                    (e = P.initCodes(), P.CODES = e);
                for (var f = this.pos, g = a & 3, i = f + (a - g), b = Ga.alloc(3 * (a >> 2) + (2 <= g ? g - 1 : 0)), c = 0; f < i;) {
                    var k = e[E.fastCodeAt(d, f++)],
                        l = e[E.fastCodeAt(d, f++)];
                    b.set(c++, k << 2 | l >> 4);
                    k = e[E.fastCodeAt(d, f++)];
                    b.set(c++, l << 4 | k >> 2);
                    l = e[E.fastCodeAt(d, f++)];
                    b.set(c++, k << 6 | l)
                }
                2 <= g && (l = e[E.fastCodeAt(d, f++)], i = e[E.fastCodeAt(d, f++)], b.set(c++, l << 2 | i >> 4), 3 == g && (d = e[E.fastCodeAt(d, f++)], b.set(c++, i << 4 | d >> 2)));
                this.pos += a;
                this.cache.push(b);
                return b;
            case 67:
                a = this.unserialize();
                b = this.resolver.resolveClass(a);
                if (null == b) throw "Class not found " + a;
                a = F.createEmptyInstance(b);
                this.cache.push(a);
                a.hxUnserialize(this);
                if (103 != this.get(this.pos++)) throw "Invalid custom data";
                return a
            }
            this.pos--;
            throw "Invalid char " + this.buf.charAt(this.pos) + " at position " + this.pos;
        },
        __class__: P
    };
    var aa = function () {
        this.h = {}
    };
    f["haxe.ds.IntMap"] = aa;
    aa.__name__ = ["haxe", "ds", "IntMap"];
    aa.__interfaces__ = [Db];
    aa.prototype = {
        set: function (a, b) {
            this.h[a] = b
        },
        get: function (a) {
            return this.h[a]
        },
        exists: function (a) {
            return this.h.hasOwnProperty(a)
        },
        remove: function (a) {
            if (!this.h.hasOwnProperty(a)) return !1;
            delete this.h[a];
            return !0
        },
        keys: function () {
            var a = [],
                b;
            for (b in this.h) this.h.hasOwnProperty(b) && a.push(b | 0);
            return s.iter(a)
        },
        __class__: aa
    };
    var xa = function () {
        this.h = {};
        this.h.__keys__ = {}
    };
    f["haxe.ds.ObjectMap"] = xa;
    xa.__name__ = ["haxe", "ds", "ObjectMap"];
    xa.__interfaces__ = [Db];
    xa.prototype = {
        set: function (a, b) {
            var c = a.__id__ || (a.__id__ = ++xa.count);
            this.h[c] = b;
            this.h.__keys__[c] = a
        },
        keys: function () {
            var a = [],
                b;
            for (b in this.h.__keys__) this.h.hasOwnProperty(b) &&
                a.push(this.h.__keys__[b]);
            return s.iter(a)
        },
        __class__: xa
    };
    var O = function () {
        this.h = {}
    };
    f["haxe.ds.StringMap"] = O;
    O.__name__ = ["haxe", "ds", "StringMap"];
    O.__interfaces__ = [Db];
    O.prototype = {
        set: function (a, b) {
            this.h["$" + a] = b
        },
        get: function (a) {
            return this.h["$" + a]
        },
        exists: function (a) {
            return this.h.hasOwnProperty("$" + a)
        },
        keys: function () {
            var a = [],
                b;
            for (b in this.h) this.h.hasOwnProperty(b) && a.push(b.substr(1));
            return s.iter(a)
        },
        iterator: function () {
            return {
                ref: this.h,
                it: this.keys(),
                hasNext: function () {
                    return this.it.hasNext()
                },
                next: function () {
                    return this.ref["$" + this.it.next()]
                }
            }
        },
        __class__: O
    };
    var Ga = function (a, b) {
        this.length = a;
        this.b = b
    };
    f["haxe.io.Bytes"] = Ga;
    Ga.__name__ = ["haxe", "io", "Bytes"];
    Ga.alloc = function (a) {
        for (var b = [], c = 0; c < a;) c++, b.push(0);
        return new Ga(a, b)
    };
    Ga.prototype = {
        get: function (a) {
            return this.b[a]
        },
        set: function (a, b) {
            this.b[a] = b & 255
        },
        __class__: Ga
    };
    var bc = function () {};
    f["haxe.rtti.Meta"] = bc;
    bc.__name__ = ["haxe", "rtti", "Meta"];
    bc.getType = function (a) {
        a = a.__meta__;
        return null == a || null == a.obj ? {} : a.obj
    };
    var D =
        function () {};
    f["js.Boot"] = D;
    D.__name__ = ["js", "Boot"];
    D.getClass = function (a) {
        return a instanceof Array && null == a.__enum__ ? Array : a.__class__
    };
    D.__string_rec = function (a, b) {
        if (null == a) return "null";
        if (5 <= b.length) return "<...>";
        var c = typeof a;
        if ("function" == c && (a.__name__ || a.__ename__)) c = "object";
        switch (c) {
        case "object":
            if (a instanceof Array) {
                if (a.__enum__) {
                    if (2 == a.length) return a[0];
                    for (var c = a[0] + "(", b = b + "\t", d = 2, e = a.length; d < e;) var f = d++,
                    c = 2 != f ? c + ("," + D.__string_rec(a[f], b)) : c + D.__string_rec(a[f], b);
                    return c + ")"
                }
                c = a.length;
                d = "[";
                b += "\t";
                for (e = 0; e < c;) f = e++, d += (0 < f ? "," : "") + D.__string_rec(a[f], b);
                return d + "]"
            }
            try {
                d = a.toString
            } catch (g) {
                return "???"
            }
            if (null != d && d != Object.toString && (c = a.toString(), "[object Object]" != c)) return c;
            c = null;
            d = "{\n";
            b += "\t";
            e = null != a.hasOwnProperty;
            for (c in a)
                if (!e || a.hasOwnProperty(c)) "prototype" == c || "__class__" == c || "__super__" == c || "__interfaces__" == c || "__properties__" == c || (2 != d.length && (d += ", \n"), d += b + c + " : " + D.__string_rec(a[c], b));
            b = b.substring(1);
            return d + ("\n" + b + "}");
        case "function":
            return "<function>";
        case "string":
            return a;
        default:
            return "" + a
        }
    };
    D.__interfLoop = function (a, b) {
        if (null == a) return !1;
        if (a == b) return !0;
        var c = a.__interfaces__;
        if (null != c)
            for (var d = 0, e = c.length; d < e;) {
                var f = d++,
                    f = c[f];
                if (f == b || D.__interfLoop(f, b)) return !0
            }
        return D.__interfLoop(a.__super__, b)
    };
    D.__instanceof = function (a, b) {
        if (null == b) return !1;
        switch (b) {
        case lc:
            return (a | 0) === a;
        case ic:
            return "number" == typeof a;
        case jc:
            return "boolean" == typeof a;
        case String:
            return "string" == typeof a;
        case Array:
            return a instanceof
            Array && null == a.__enum__;
        case mc:
            return !0;
        default:
            if (null != a) {
                if ("function" == typeof b && (a instanceof b || D.__interfLoop(D.getClass(a), b))) return !0
            } else return !1;
            return b == nc && null != a.__name__ || b == oc && null != a.__ename__ ? !0 : a.__enum__ == b
        }
    };
    D.__cast = function (a, b) {
        if (D.__instanceof(a, b)) return a;
        throw "Cannot cast " + y.string(a) + " to " + y.string(b);
    };
    var ac = function () {};
    f["js.Browser"] = ac;
    ac.__name__ = ["js", "Browser"];
    ac.getLocalStorage = function () {
        try {
            var a = window.localStorage;
            a.getItem("");
            return a
        } catch (b) {
            return null
        }
    };
    var Wb = function (a,b,level) {
        this.root = (new G).add(new ja(!1));
        e.addFillSprite(this.root, e.halfWidth, e.halfHeight, 0, e.width, e.height, 0.8);
        e.addImageSprite(this.root, e.halfWidth, e.halfHeight, "game_scene_bg")._compMap.Sprite_0.setRotation(180);  //游戏结束背景
        console.log(a+"哈哈"+level)

        /*function Ajax(type, url, data, success, failed){
            // 创建ajax对象
            var xhr = null;
            if(window.XMLHttpRequest){
                xhr = new XMLHttpRequest();
            } else {
                xhr = new ActiveXObject('Microsoft.XMLHTTP')
            }

            var type = type.toUpperCase();
            // 用于清除缓存
            var random = Math.random();

            if(typeof data == 'object'){
                // console.log(data);
                var str = '';
                for(var key in data){
                     str += key+'='+data[key]+'&';
                     // console.log(str);
                }
                 data = str.replace(/&$/, '');
            }

            if(type == 'GET'){
                if(data){
                    xhr.open('GET', url + '?' + data, true);
                } else {
                    xhr.open('GET', url + '?t=' + random, true);
                }
                xhr.send();

            } else if(type == 'POST'){
                xhr.open('POST', url, true);
                // 如果需要像 html 表单那样 POST 数据，请使用 setRequestHeader() 来添加 http 头。
                xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
                xhr.send(data);
            }

            // 处理返回数据
            xhr.onreadystatechange = function(){
                if(xhr.readyState == 4){
                    if(xhr.status == 200){
                        success(xhr.responseText);
                    } else {
                        if(failed){
                            failed(xhr.status);
                        }
                    }
                }
            }
        }*/
        var that=this;
        var  xhr = new XMLHttpRequest();
        xhr.open("post","/carful/carfulLevel",true);
        xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
        xhr.send("level="+level);
        xhr.onreadystatechange = function(){
            if (xhr.readyState == 4) {
                if ( xhr.status >= 200 && xhr.status < 300 ) {

                    var hehe=xhr.responseText;
                    var split4 = hehe.split("{");
                    var split5 = split4[1].split("}");
                    var split1=split5[0].split(",");
                    for(var i=0;i<split1.length;i++){
                        var split2=split1[i].split(":");

                        if(split2[0] == '"code"'){
                            var code = split2[1];
                            document.getElementById("code").innerHTML = code;
                            //$("#code").text(code);
                        }
                        if(split2[0] == '"goods"'){
                            var goods = split2[1];
                            document.getElementById("goods").innerHTML = goods;
                        }
                        if(split2[0] == '"money"'){
                            var money = split2[1];
                            document.getElementById("money").innerHTML = money;
                        }
                        if(split2[0] == '"hasPrize"'){
                           var  hp = split2[1];
                        }

                    }
                    if(level-1<1){
                        //if(level-1<5){
                        //闯关小于5关失败 随机产生失败页
                        var r=Math.round(Math.random())
                        if(r==0){
                            e.addImageSprite(that.root, e.halfWidth, 500, "game_over_icon");		//图片下移
                            //a = e.addLabel(this.root, e.halfWidth, e.halfHeight, "" + a, 1, 1, !0);    //隐藏了分数
                            //e.addImageSprite(a, -40, 0, "score_icon");								 //隐藏了奖杯图标
                            e.addButton(that.root, e.halfWidth, e.halfHeight + 380, "replay_btn", function () {
                                o.unmuteSoundtrack();
                                e.goToScene((new t(0)).root)
                            });
                            e.addButton(that.root, e.halfWidth+250, e.halfHeight - 420, "close", function () {
                                e.goToScene((new Ia).root)		//跳转到本游戏的首页
                            });
                        }else{
                            e.addImageSprite(that.root, e.halfWidth, 500, "fail1");
                            e.addButton(that.root, e.halfWidth, e.halfHeight + 280, "replay_btn", function () {
                                o.unmuteSoundtrack();
                                e.goToScene((new t(0)).root)
                            });
                            e.addButton(that.root, e.halfWidth+260, e.halfHeight - 435, "close", function () {
                                e.goToScene((new Ia).root)		//跳转到本游戏的首页
                            });
                        }

                    }
                    //闯关大于等于5关小于20关获得掷骰子一次
                    if(level-1>=1&&level-1<2){
                        //if(level-1>=5&&level-1<20){
                        e.addImageSprite(that.root, e.halfWidth, 500, "success");
                        e.addButton(that.root, e.halfWidth, e.halfHeight + 260, "replay_btn", function () {
                            o.unmuteSoundtrack();
                            e.goToScene((new t(0)).root)
                        });
                        e.addButton(that.root, e.halfWidth+250, e.halfHeight - 410, "close", function () {
                            e.goToScene((new Ia).root)		//跳转到本游戏的首页
                        });
                    }
                    //闯关大于等于20关获得奖品
                    // if(level-1>=20){
                    if(level-1>=2){
                        //判断奖品是否领完

                        if(hp==1){
                            //奖品未领完
                            setTimeout(function(){
                                document.getElementById("success").style.display="block";
                            },10)
                            //      	document.getElementById("money").innerText="";	//钱
                            //      	document.getElementById("goods").innerText="";	//奖品
                            //      	document.getElementById("code").innerText="";	//编码
                            e.addImageSprite(that.root, e.halfWidth, 500, "success1");
                            e.addButton(that.root, e.halfWidth+100, e.halfHeight + 350, "replay_btn", function () {
                                o.unmuteSoundtrack();
                                e.goToScene((new t(0)).root)
                                setTimeout(function(){
                                    document.getElementById("success").style.display="none";
                                },100)
                            });
                            e.addButton(that.root, e.halfWidth-100, e.halfHeight + 350, "prize", function () {
                                // alert("我的奖品")
                                var index=layer.open({type:2,shadeClose:false});

                                setTimeout(function(){
                                    document.getElementById("success").style.display="none";
                                    layer.close(index);
                                    location.href="/carful/myPrize";
                                },100)
                            });
                            e.addButton(that.root, e.halfWidth+250, e.halfHeight - 410, "close", function () {
                                e.goToScene((new Ia).root)		//跳转到本游戏的首页
                                setTimeout(function(){
                                    document.getElementById("success").style.display="none";
                                },100)
                            });
                        }else if(hp==0){
                            //奖品已领完
                            e.addImageSprite(that.root, e.halfWidth, 500, "noPrize");
                            e.addButton(that.root, e.halfWidth, e.halfHeight + 260, "replay_btn", function () {
                                o.unmuteSoundtrack();
                                e.goToScene((new t(0)).root)
                            });
                            e.addButton(that.root, e.halfWidth+260, e.halfHeight - 435, "close", function () {
                                e.goToScene((new Ia).root)		//跳转到本游戏的首页
                            });
                        }
                    }

                };
            };
        }

        e.addButton(this.root, e.halfWidth - 150, e.halfHeight + 1300, "home_btn", function () {	//结束页面home按钮下移隐藏
            o.unmuteSoundtrack();
            e.goToScene((new Ia).root)
        });
        e.addButton(this.root, e.halfWidth + 150, e.halfHeight + 1300, "more_games_btn", function () {		//结束页面游戏按钮下移隐藏
            //e.openUrl("m.softgames.de")
            SG.redirectToPortal();
        })
    };
    f["scenes.GameOverScene"] = Wb;
    Wb.__name__ = ["scenes", "GameOverScene"];
    Wb.prototype = {
        __class__: Wb
    };
    var t = function () {
        this.root = (new G).add(new ja);
        var a = this;
        this.root.add(new ga);
        e.addImageSprite(this.root, 0, 0, "game_scene_bg", 1, 1, !1);
        var b = e.addImageSprite(this.root, -7, -70, "spikes_block", 1, 1, !1);
        t.spikesBlock = b._compMap.Sprite_0;
        e.addImageSprite(this.root, 0,
            0, "hud_bg", 1, 1, !1);
        1 == t.cLevel && (t.totalScore = 0, e.addDelay(this.root, 0.2, function () {
            e.pushScene((new Xb).root)
        }, !1));
        e.addDelay(this.root, 0.8, function () {
            SG_Hooks.start();
            e.addButton(a.root, 585, 60, "pause_btn", function () {
                e.pushScene((new Yb).root)
            });
            e.addButton(a.root, 395, 60, "push_btn", function () {
                a.root._compMap.GameSceneComp_7.addRow()
            });
            t.spikesBlock.y.animateTo(101, 0.8, m.linear);
            a.root.add(new Cb(t.scoreTillNextLevel(t.cLevel + 1), 0))
        }, !1)
    };
    f["scenes.GameScene"] = t;
    t.__name__ = ["scenes", "GameScene"];
    t.scoreTillNextLevel = function (a) {
        return 1E3 * a + 1E3 * a + (30 * a * a - 30 * a)
    };
    t.prototype = {
        __class__: t
    };
    var Cb = function (a, b) {
        this.levelEnd = !1;
        this.timerC = this.cLevelScore = 0;
        this.scoreTillNextLevel = a;
        this.cLevelScore = b
    };
    f["scenes.GameSceneComp"] = Cb;
    Cb.__name__ = ["scenes", "GameSceneComp"];
    Cb.__super__ = C;
    Cb.prototype = v(C.prototype, {
        get_name: function () {
            return "GameSceneComp_7"
        },
        onAdded: function () {
            this.grid = new i(this.owner, 9, 11);
            this.grid.addRandRows(8);
            this.timeTillNextRow = this.caclAddRowTimer();
            e.addLabel(this.owner,
                47, 57, "" + t.cLevel, 1, 1, !0);
            this.scoreBar = e.addPatternSprite(null, 90, 36, "bar1_fill", 0, 43, 1, 1, !1);
            e.addImageSprite(this.scoreBar, -1, -6, "bar1_mask", 1, 1, !1);
            this.scoreLabel = e.addLabel(this.scoreBar, 118, 2, "")._compMap.Sprite_0;
            this.scoreLabel.setAlign(U.Center);
            this.updateScore(0);
            this.owner.addChild(this.scoreBar);
            this.pushUpBar = e.addPatternSprite(this.owner, 441, 36, "bar2_fill", 0, 43, 1, 1, !1);
            e.addImageSprite(this.pushUpBar, 0, -7, "bar2_mask", 1, 1, !1);
            this.pushUpTimer = e.addDelay(this.owner, this.timeTillNextRow,
                fa(this, this.addRow), !0);
            this.timer = e.addDelay(this.owner, 0.1, fa(this, this.updateTimer), !0);
            this.checkForMatches()
        },
        caclAddRowTimer: function () {
            var a = 9 - (0.5 * t.cLevel | 0);
            2 > a && (a = 2);
            return a
        },
        checkForMatches: function () {
            this.levelEnd || (this.checkNextLevel(), 0 == this.grid.getDeepMatches().length && (this.pushUpTimer.dispose(), this.pushUpTimer = e.addDelay(this.owner, this.timeTillNextRow, fa(this, this.addRow), !0), this.addRow()))
        },
        addRow: function () {
            this.pushUpBar._compMap.Sprite_0.width.set__(90);
            this.timerC =
                0;
            this.levelEnd || (this.grid.pushPiecesUp() ? (this.grid.addRandRows(1), 0 == this.grid.getDeepMatches().length && this.addRow()) : this.checkGameOver())
        },
        checkNextLevel: function () {
            var a = this;
            if (this.cLevelScore >= this.scoreTillNextLevel) {
                this.levelEnd = !0;
                x.canMakeAction = !1;
                t.spikesBlock.y.animateTo(-70, 0.6, m.linear);
                this.pushUpTimer._compMap.Script_3.stopAll();
                this.timer._compMap.Script_3.stopAll();
                e.addDelay(this.owner, 1, function () {
                    a.grid.clear2()
                }, !1);
                t.cLevel += 1;
                var b = this.cLevelScore - this.scoreTillNextLevel;
                t.totalScore += this.cLevelScore;
                Y.saveHiScore(t.totalScore);
                o.playSfx("level_end_sfx");
                this.showLevelCompleteMsg();
                SG_Hooks.levelUp(t.cLevel, t.totalScore);
                e.addDelay(this.owner, 1.5, function () {
                    e.goToScene((new t(b)).root, (new xb(0.6, m.backIn)).left())
                }, !1)
            }
        },
        checkGameOver: function () {
            this.levelEnd = !0;
            x.canMakeAction = !1;
            var a = Y.HI_SCORE;
            t.totalScore += this.cLevelScore;
            Y.saveHiScore(t.totalScore);
            this.pushUpTimer._compMap.Script_3.stopAll();
            this.timer._compMap.Script_3.stopAll();
            SG_Hooks.gameOver(t.cLevel,
                t.totalScore);
            this.grid.clear();
            e.addDelay(this.owner, 2, function () {
                o.muteSoundtrack();
                o.playSfx("game_over_sfx", 0.5);
                e.pushScene((new Wb(t.totalScore, a,t.cLevel)).root);	//又加了一个参数  关数
                t.cLevel = 1;
            }, !1)
        },
        updateScore: function (a) {
            this.cLevelScore += a;
            this.cLevelScore > this.scoreTillNextLevel && (this.cLevelScore = this.scoreTillNextLevel);
            this.scoreLabel.set_text(this.cLevelScore + " > " + this.scoreTillNextLevel);
            this.scoreBar._compMap.Sprite_0.width.set__(239 * (this.cLevelScore / this.scoreTillNextLevel))
        },
        updateTimer: function () {
            this.timerC +=
                0.1;
            this.timerC > this.timeTillNextRow && (this.timerC = this.timeTillNextRow);
            this.pushUpBar._compMap.Sprite_0.width.set__(90 * (this.timerC / this.timeTillNextRow))
        },
        showLevelCompleteMsg: function () {
            e.addImageSprite(this.owner, e.halfWidth, e.height + 200, "level_end_flag")._compMap.Sprite_0.y.animateTo(e.halfHeight, 0.6, m.bounceOut)
        },
        __class__: Cb
    });
    var Xb = function () {
        this.root = (new G).add(new ja(!1));
        e.addFillSprite(this.root, e.halfWidth, e.halfHeight, 0, e.width, e.height, 0.8);
        var a;
        a = e.addLabel(this.root, e.halfWidth,
            80, e.settings.get(sa.lang + ".help1"), 1, 1, !0)._compMap.Sprite_0;
        a.setWrapWidth(e.width - 80);
        a.centerAnchor();
        e.addImageSprite(this.root, e.halfWidth, 240, "help_info_1", 1, 1);
        a = e.addLabel(this.root, e.halfWidth, 400, e.settings.get(sa.lang + ".help2"), 1, 1, !0)._compMap.Sprite_0;
        a.setWrapWidth(e.width - 80);
        a.centerAnchor();
        e.addImageSprite(this.root, e.halfWidth, 550, "help_info_2", 1, 1);
        e.addButton(this.root, e.halfWidth, e.height - 160, "play_btn2", function () {
            e.popScene(new qa(0.2))
        })
    };
    f["scenes.HelpScene"] = Xb;
    Xb.__name__ = ["scenes", "HelpScene"];
    Xb.prototype = {
        __class__: Xb
    };
    var Ia = function () {
        this.root = (new G).add(new ja);
        o.playSoundtrack("soundtrack1", 0.2);
        e.addImageSprite(this.root, e.halfWidth, e.halfHeight, "game_scene_bg")._compMap.Sprite_0.setRotation(180);
        var a;
        a = e.addImageSprite(this.root, e.halfWidth, e.halfHeight - 270, "game_title", 1, 1)._compMap.Sprite_0;
        
        a.alpha.animateTo(1, 1, m.quadOut);
        a.y.animateTo(e.halfHeight , 1, m.bounceOut);
        a = e.addLabel(this.root, e.halfWidth, e.height + 50, "" + Y.HI_SCORE, 1, 0, !0)._compMap.Sprite_0;
        a.alpha.animateTo(1, 1, m.quadOut);
        a.y.animateTo(e.height + 100, 1, m.bounceOut);		//首页下边的分数按钮下移出边界隐藏了
        e.addImageSprite(a.owner, -40, 0, "score_icon");
        a = e.addButton(this.root, e.halfWidth, e.height - 200, "play_btn2", function () {
            e.goToScene((new t(0)).root)
        }, "", 1, 0)._compMap.Sprite_0;
        a.alpha.animateTo(1, 1, m.quadOut);
        a.y.animateTo(e.height - 60, 1, m.bounceOut);		//首页中间的开始游戏按钮下移
        a = e.addButton(this.root, e.halfWidth + 220, e.height - 140, "sound_on_btn", function () {
            o.muteAll()
        },"sound_off_btn", 0, 0)._compMap.Sprite_0;		//第一个  将1改成0  声音按钮就消失了
        a.owner.firstChild._compMap.Sprite_0.set_visible(o.isMuted);
        a.alpha.animateTo(1, 1, m.quadOut);
        a.y.animateTo(e.height + 250, 1, m.bounceOut);    	//首页右边的声音按钮下移出边界隐藏了
        a = e.addButton(this.root, e.halfWidth - 220, e.height - 140, "more_games_btn", function () {
            //e.openUrl("m.softgames.de")
            SG.redirectToPortal();
        }, "", 0, 0)._compMap.Sprite_0;		//第一个  将1改成0  游戏按钮就消失了
        a.alpha.animateTo(1, 1, m.quadOut);
        a.y.animateTo(e.height + 250, 1, m.bounceOut)   	//首页左边的游戏按钮下移出边界隐藏了
        
        
        a = e.addButton(this.root, e.halfWidth + 260, e.height - 140, "close", function () {
        	window.location.href="/wxcs?shuju=1";	//跳转到主页面   也就是掷骰子走步数页面,张俊

            //e.openUrl("m.softgames.de")
            SG.redirectToPortal();
        }, "", 1, 1)._compMap.Sprite_0;
        a.alpha.animateTo(1, 1, m.quadOut);
        a.y.animateTo(e.height - 910, 1, m.bounceOut)   	//关闭按钮
    };
    
    f["scenes.MainScene"] = Ia;
    Ia.__name__ = ["scenes", "MainScene"];
    Ia.prototype = {
        __class__: Ia
    };
    var Yb = function () {
        this.root = (new G).add(new ja(!1));
        e.addFillSprite(this.root, e.halfWidth, e.halfHeight, 0, e.width, e.height, 0.8);
        e.addFillSprite(this.root, e.halfWidth - 50, e.halfHeight - 280, 16777215, 60, 160, 1);
        e.addFillSprite(this.root, e.halfWidth + 50, e.halfHeight - 280, 16777215, 60, 160, 1);
        e.addButton(this.root, e.halfWidth, e.halfHeight + 5, "play_btn2", function () {
            t.cLevel = 1;
            e.goToScene((new t(0)).root)
        });
        e.addButton(this.root, e.halfWidth - 150, e.halfHeight + 200, "home_btn", function () {
            e.goToScene((new Ia).root)
        });
        e.addButton(this.root, e.halfWidth, e.halfHeight + 200, "replay_btn", function () {
            e.popScene(new qa(0))
        });
        e.addButton(this.root, e.halfWidth +
            150, e.halfHeight + 200, "sound_on_btn", function () {
                o.muteAll()
            }, "sound_off_btn").firstChild._compMap.Sprite_0.set_visible(o.isMuted)
    };
    f["scenes.PauseScene"] = Yb;
    Yb.__name__ = ["scenes", "PauseScene"];
    Yb.prototype = {
        __class__: Yb
    };
    var o = function () {};
    f["yzi.Sfx"] = o;
    o.__name__ = ["yzi", "Sfx"];
    o.playSfx = function (a, b) {
        null == b && (b = 1);
        return o.isMuted ? null : e.assets.getSound(o.soundsFolder + "/" + a).play(b)
    };
    o.playSoundtrack = function (a, b) {
        null == b && (b = 1);
        var c = e.assets.getSound(o.soundsFolder + "/" + a);
        null != o.cSoundtrackPlayback ?
            o.cSoundtrackPlayback.get_sound() != c && (o.cSoundtrackVolume = b, o.cSoundtrackPlayback = c.loop(b)) : (o.cSoundtrackVolume = b, o.cSoundtrackPlayback = c.loop(b));
        return o.cSoundtrackPlayback
    };
    o.muteSoundtrack = function () {
        null != o.cSoundtrackPlayback && (o.cSoundtrackPlayback.volume.animateTo(0, 1), e.addDelay(null, 0.8, function () {
            o.cSoundtrackPlayback.set_paused(!0)
        }, !1))
    };
    o.unmuteSoundtrack = function () {
        null != o.cSoundtrackPlayback && !o.isMuted && (o.cSoundtrackPlayback.set_paused(!1), o.cSoundtrackPlayback.volume.animateTo(o.cSoundtrackVolume,
            1))
    };
    o.muteAll = function () {
        o.isMuted ? (o.isMuted = !1, o.unmuteSoundtrack(), l.volume.animateTo(1, 0)) : (o.isMuted = !0, o.muteSoundtrack(), l.volume.animateTo(0, 1))
    };
    var S = function () {};
    f["yzi.Tweener"] = S;
    S.__name__ = ["yzi", "Tweener"];
    S.to = function (a, b, c, d, e, f) {
        null == d && (d = 0);
        m;
        var g = new ha;
        0 > d && (d = 0);
        if (0 == b && 0 == d) S.apply(a, c, e);
        else {
            if (0 == b && 0 < d) {
                var i = new G;
                0 != d && g.add(new $(d));
                g.add(new Q(function () {
                    S.apply(a, c, e);
                    i.dispose()
                }));
                b = new ga;
                l.root.addChild(i.add(b))
            } else {
                0 < d && g.add(new $(d));
                for (var d = [], k =
                        0, o = z.fields(c); k < o.length;) {
                    var n = o[k];
                    ++k;
                    var q = z.getProperty(a, n);
                    d.push(new yb(q, z.field(c, n), b, f))
                }
                f = new zb(d);
                g.add(f);
                var p = new G;
                g.add(new $(b));
                g.add(new Q(function () {
                    null != e && e();
                    p.dispose()
                }));
                b = new ga;
                l.root.addChild(p.add(b))
            }
            b.run(g)
        }
    };
    S.apply = function (a, b, c) {
        for (var d = 0, e = z.fields(b); d < e.length;) {
            var f = e[d];
            ++d;
            var g = z.getProperty(a, f);
            D.__cast(g, A).set__(z.field(b, f))
        }
        null != c && c()
    };
    var e = function (a, b) {
        this.init = new pa;
        var c = this;
        e.width = a;
        e.height = b;
        e.halfWidth = a / 2 | 0;
        e.halfHeight =
            b / 2 | 0;
        e.director = (new G).add(new r).add((new wb).setSize(e.width, e.height));
        l.root.addChild(e.director);
        this.systemBg = e.initFillSpriteComp(0, 0, e.systemBgColor, 0, 0, 1, !1);
        l.root.add(this.systemBg);
        this.leftBorder = e.addFillSprite(l.root, 0, 0, e.systemBgColor, 0, 0, 1, !1)._compMap.Sprite_0;
        this.rightBorder = e.addFillSprite(l.root, 0, 0, e.systemBgColor, 0, 0, 1, !1)._compMap.Sprite_0;
        this.topBorder = e.addFillSprite(l.root, 0, 0, e.systemBgColor, 0, 0, 1, !1)._compMap.Sprite_0;
        this.bottomBorder = e.addFillSprite(l.root, 0, 0,
            e.systemBgColor, 0, 0, 1, !1)._compMap.Sprite_0;
        l.loadAssetPack(T.fromAssets("boot")).get(function (a) {
            e.assets = a;
            a = e.addFillSprite(l.root, 0, 0, 1118481, l._platform.getStage().get_width(), l._platform.getStage().get_height(), 1, !1);
            c.rotPhonePrompt = a._compMap.Sprite_0;
            a = e.addImageSprite(c.rotPhonePrompt.owner, 0, 0, "rot_phone")._compMap.Sprite_0;
            e.defaultOrientation == ea.Landscape && a.setRotation(90);
            (e.defaultOrientation == l._platform.getStage().orientation._value || null == l._platform.getStage().orientation._value) &&
                c.rotPhonePrompt.set_visible(!1);
            l._platform.getStage().lockOrientation(e.defaultOrientation);
            l._platform.getStage().requestFullscreen(!0);
            l._platform.getStage().orientation.get_changed().connect(fa(c, c.onOrientationChange));
            l._platform.getStage().resize.connect(fa(c, c.onResize));
            c.onResize();
            c.initPreloaderScene()
        })
    };
    f["yzi.YZI"] = e;
    e.__name__ = ["yzi", "YZI"];
    e.onResizeCallback = function () {};
    e.onOrientationChangeCallback = function () {};
    e.goToScene = function (a, b) {
        null == b && (b = new qa(0.5, m.quadOut));
        e.director._compMap.Director_5.unwindToScene(a,
            b)
    };
    e.pushScene = function (a, b) {
        null == b && (b = new qa(0.5, m.quadOut));
        e.director._compMap.Director_5.pushScene(a, b)
    };
    e.popScene = function (a) {
        null == a && (a = new qa(0.5, m.quadOut));
        e.director._compMap.Director_5.popScene(a)
    };
    e.saveData = function (a, b) {
        return l._platform.getStorage().set(a, b)
    };
    e.loadData = function (a) {
        return l._platform.getStorage().get(a)
    };
    e.initFillSpriteComp = function (a, b, c, d, e, f, g) {
        null == g && (g = !0);
        null == f && (f = 1);
        c = new fb(c, d, e);
        c.setXY(a, b);
        c.setAlpha(f);
        g && c.centerAnchor();
        return c
    };
    e.initImageSpriteComp =
        function (a, b, c, d, f, j) {
            null == j && (j = !0);
            null == f && (f = 1);
            null == d && (d = 1);
            c = new ib(e.assets.getTexture(c));
            c.setXY(a, b);
            c.setScale(d);
            c.setAlpha(f);
            j && c.centerAnchor();
            return c
    };
    e.initPatternSpriteComp = function (a, b, c, d, f, j, g, i) {
        null == i && (i = !0);
        null == g && (g = 1);
        null == j && (j = 1);
        c = new jb(e.assets.getTexture(c), d, f);
        c.setXY(a, b);
        c.setScale(j);
        c.setAlpha(g);
        i && c.centerAnchor();
        return c
    };
    e.initTextSpriteComp = function (a, b, c, d, f, j, g) {
        null == g && (g = "");
        null == j && (j = !1);
        null == f && (f = 1);
        null == d && (d = 1);
        null == c && (c = "Label");
        "" == g && (g = e.defaultFont);
        c = new lb(new Ca(e.assets, g), c);
        c.setXY(a, b);
        c.setScale(d);
        c.setAlpha(f);
        j && c.centerAnchor();
        return c
    };
    e.addFillSprite = function (a, b, c, d, f, j, g, i) {
        null == i && (i = !0);
        null == g && (g = 1);
        var k = new G;
        k.add(new na);
        k.add(e.initFillSpriteComp(b, c, d, f, j, g, i));
        null != a && a.addChild(k);
        return k
    };
    e.addImageSprite = function (a, b, c, d, f, g, i) {
        null == i && (i = !0);
        null == g && (g = 1);
        null == f && (f = 1);
        var l = new G;
        l.add(new na);
        l.add(e.initImageSpriteComp(b, c, d, f, g, i));
        null != a && a.addChild(l);
        return l
    };
    e.addPatternSprite =
        function (a, b, c, d, f, g, i, l, k) {
            null == k && (k = !0);
            null == l && (l = 1);
            null == i && (i = 1);
            var m = new G;
            m.add(new na);
            m.add(e.initPatternSpriteComp(b, c, d, f, g, i, l, k));
            null != a && a.addChild(m);
            return m
    };
    e.addLabel = function (a, b, c, d, f, g, i, l) {
        null == l && (l = "");
        null == i && (i = !1);
        null == g && (g = 1);
        null == f && (f = 1);
        null == d && (d = "Label");
        var k = new G;
        k.add(new na);
        k.add(e.initTextSpriteComp(b, c, d, f, g, i, l));
        null != a && a.addChild(k);
        return k
    };
    e.addButton = function (a, b, c, d, f, g, i, l) {
        null == l && (l = 1);
        null == i && (i = 1);
        null == g && (g = "");
        var k = e.addImageSprite(a,
            b, c, d, i, l, !0);
        k.add(new ga);
        "" != g && (e.addImageSprite(k, 0, 0, g, 1, 1, !1), k.firstChild._compMap.Sprite_0.set_visible(!1));
        var n = new ha;
        n.add(new Q(function () {
            k._compMap.Sprite_0.scaleX.animateTo(1.15, 0.2, m.backOut);
            k._compMap.Sprite_0.scaleY.animateTo(1.15, 0.2, m.backOut)
        }));
        n.add(new $(0.2));
        n.add(new Q(function () {
            k._compMap.Sprite_0.scaleX.animateTo(1, 0.1, m.quadIn);
            k._compMap.Sprite_0.scaleY.animateTo(1, 0.1, m.quadIn)
        }));
        k._compMap.Disposer_2.connect1(k._compMap.Sprite_0.get_pointerDown(), function () {
            k._compMap.Script_3.run(n)
        });
        k._compMap.Disposer_2.connect1(k._compMap.Sprite_0.get_pointerUp(), function () {
            "" != g && (0 == (k.firstChild._compMap.Sprite_0._flags & 1) ? k.firstChild._compMap.Sprite_0.set_visible(!0) : k.firstChild._compMap.Sprite_0.set_visible(!1));
            "" != e.buttonClickSfx && o.playSfx(e.buttonClickSfx);
            null != f && f()
        });
        return k
    };
    e.addDelay = function (a, b, c, d) {
        var e = new G,
            f = new ha;
        f.add(new $(b));
        f.add(new Q(function () {
            null != c && c();
            d || e.dispose()
        }));
        b = new ga;
        e.add(new na);
        e.add(b);
        null != a && a.addChild(e);
        d ? b.run(new Ab(f)) : b.run(f);
        return e
    };
    e.openUrl = function (a) {
        l._platform.getWeb().openBrowser("http://" + a)
    };
    e.rand = function (a) {
        return y.random(a)
    };
    e.randSign = function () {
        var a = 1;
        0 == y.random(2) && (a = -1);
        return a
    };
    e.prototype = {
        onResize: function () {
            var a = l._platform.getStage().get_width(),
                b = l._platform.getStage().get_height(),
                c = Math.min(a / e.width, b / e.height);
            e.director._compMap.Sprite_0.setXY(0.5 * a - 0.5 * c * e.width, 0.5 * b - 0.5 * c * e.height);
            e.director._compMap.Sprite_0.setScale(c);
            var d = e.director._compMap.Sprite_0.x._value,
                f = e.director._compMap.Sprite_0.y._value;
            this.systemBg.setXY(0, 0);
            this.systemBg.setSize(a, b);
            this.leftBorder.setXY(0, f);
            this.leftBorder.setSize(d, b - 2 * f);
            this.rightBorder.setXY(a - d, f);
            this.rightBorder.setSize(d, b - 2 * f);
            this.topBorder.setXY(0, 0);
            this.topBorder.setSize(a, f);
            this.bottomBorder.setXY(0, b - f);
            this.bottomBorder.setSize(a, f);
            e.onResizeCallback();
            this.rotPhonePrompt.setXY(0, 0);
            this.rotPhonePrompt.setSize(l._platform.getStage().get_width(), l._platform.getStage().get_height());
            this.rotPhonePrompt.owner.firstChild._compMap.Sprite_0.setXY(this.rotPhonePrompt.width._value /
                2, this.rotPhonePrompt.height._value / 2);
            this.rotPhonePrompt.owner.firstChild._compMap.Sprite_0.setScale(c)
        },
        onOrientationChange: function (a) {
            e.onOrientationChangeCallback();
            e.defaultOrientation != a ? this.rotPhonePrompt.set_visible(!0) : this.rotPhonePrompt.set_visible(!1)
        },
        initPreloaderScene: function () {
            var a = this,
                b = e.width - 150,
                c = (new G).add(new ja),
                d = e.addFillSprite(c, 0, 0, 1118481, e.width, e.height, 1, !1),
                f = e.addFillSprite(d, e.halfWidth, e.halfHeight, 16777215, b, 50),
                g = e.addFillSprite(f, 4, 4, 1118481, 0, 42, 1, !1),
                i = l.loadAssetPack(T.fromAssets("main"));
            i.get(function (b) {
                e.assets = b;
                e.settings = Ua.parse(b.getFile("settings.ini").toString());
                c.removeChild(f);
                a.init.emit()
            });
            i.progressChanged.connect(function () {
                var a = i._progress / i._total;
                1 < a && (a = 1);
                g._compMap.Sprite_0.width.set__(a * (b - 8))
            });
            e.goToScene(c)
        },
        __class__: e
    };
    var kc = 0;
    Math.NaN = Number.NaN;
    Math.NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
    Math.POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
    f.Math = Math;
    Math.isFinite = function (a) {
        return isFinite(a)
    };
    Math.isNaN =
        function (a) {
            return isNaN(a)
    };
    String.prototype.__class__ = f.String = String;
    String.__name__ = ["String"];
    f.Array = Array;
    Array.__name__ = ["Array"];
    Date.prototype.__class__ = f.Date = Date;
    Date.__name__ = ["Date"];
    var lc = f.Int = {
        __name__: ["Int"]
    }, mc = f.Dynamic = {
            __name__: ["Dynamic"]
        }, ic = f.Float = Number;
    ic.__name__ = ["Float"];
    var jc = f.Bool = Boolean;
    jc.__ename__ = ["Bool"];
    var nc = f.Class = {
        __name__: ["Class"]
    }, oc = {};
    Y.HI_SCORE = 0;
    i.dirs = [new la(0, -1), new la(0, 1), new la(1, 0), new la(-1, 0)];
    i.pieceWidth = 70;
    i.pieceHeight = 70;
    i.gap =
        0;
    i.offsetX = 0;
    i.offsetY = 220;
    i.pieceTypes = 5;
    i.minMatchForBonus = 6;
    x.canMakeAction = !0;
    oa.instance = new oa;
    H.DISPATCHING_SENTINEL = new Ba(null, null);
    l.root = new G;
    l.uncaughtError = new B;
    l.hidden = new M(!1);
    l.volume = new A(1);
    l._platform = oa.instance;
    l._calledInit = !1;
    T.__meta__ = {
        obj: {
            assets: [{
                main: [{
                    bytes: 157,
                    md5: "2d92dff705275d5293ff0313aea47be3",
                    name: "bar1_fill.png"
                }, {
                    bytes: 857,
                    md5: "bd5965657c037fe0f2c8b70c3648f4d2",
                    name: "bar1_mask.png"
                }, {
                    bytes: 166,
                    md5: "2165e3d2d9a4c158057c204510cfe4a0",
                    name: "bar2_fill.png"
                }, {
                    bytes: 784,
                    md5: "4a363595d3cdfd816da424cec5526961",
                    name: "bar2_mask.png"
                }, {
                    bytes: 3444,
                    md5: "71569afb72a0c8aa44feefd66fbf48f2",
                    name: "bl0.png"
                }, {
                    bytes: 3796,
                    md5: "ebace59cd33cc7f385a9f9770fb7ba9c",
                    name: "bl1.png"
                }, {
                    bytes: 4424,
                    md5: "07ac200e9e4c838a244a3bfa067c74a2",
                    name: "bl2.png"
                }, {
                    bytes: 3375,
                    md5: "47657b6a5762056fd711ae3ab6e2971c",
                    name: "bl3.png"
                }, {
                    bytes: 3364,
                    md5: "9c689022acf1cae669646b5124e432e7",
                    name: "bl4.png"
                }, {
                    bytes: 3782,
                    md5: "baf610c8492e30c6941ebb172011df57",
                    name: "bl5.png"
                }, {
                    bytes: 3626,
                    md5: "afcac7950499aa74408f1c0da431f177",
                    name: "bl6.png"
                }, {
                    bytes: 3724,
                    md5: "7d0e04309859451090f6c5b8047a3279",
                    name: "bl7.png"
                }, {
                    bytes: 3706,
                    md5: "df590a1a02c53a5312fcf6d6b2f53b54",
                    name: "bl8.png"
                }, {
                    bytes: 3612,
                    md5: "7cea95baaee7e8cec2bae66797a45809",
                    name: "bl9.png"
                }, {
                    bytes: 1307,
                    md5: "46f04dbb3c32581ed5b43d6098183fd9",
                    name: "bonus_marker.png"
                }, {
                    bytes: 22501,
                    md5: "8331c982be1348f2044e7d040410e6a2",
                    name: "debug_font.fnt"
                }, {
                    bytes: 16702,
                    md5: "8817285aff7592f450f4116b3c6c9360",
                    name: "debug_font.png"
                }, {
                    bytes: 112089,
                    md5: "9567a450930ffba63782eb8f2f56f295",
                    name: "default_font1.fnt"
                }, {
                    bytes: 175852,
                    md5: "75c0d6f1e642244c6a4978267ada6a61",
                    name: "default_font1.png"
                }, {
                    bytes: 8551,
                    md5: "d8947acd6e48e154224e0f4618c84e65",
                    name: "game_over_icon.png"
                }, {
                    bytes: "",
                    md5: "",
                    name: "game_scene_bg.png"
                }, {
                    bytes: 56385,
                    md5: "431175de2d871779ba6a3c6eaa008cdc",
                    name: "game_title.png"
                }, {
                    bytes: 44405,
                    md5: "d5e5b0226ec8bbc1ccf84c75edafa48a",
                    name: "help_info_1.png"
                }, {
                    bytes: 38435,
                    md5: "e09a06563c4977c95720988586637b0e",
                    name: "help_info_2.png"
                }, {
                    bytes: 10039,
                    md5: "513eb9f9c26773ee5436ed05f7d99676",
                    name: "home_btn.png"
                }, {
                    bytes: 2373,
                    md5: "4539fe05e154640b976ec0bea3f31bbe",
                    name: "hud_bg.png"
                }, {
                    bytes: 18036,
                    md5: "73da187e3ceac2fb394acb081b4cb51c",
                    name: "level_end_flag.png"
                }, {
                    bytes: 9928,
                    md5: "5e8fa402be18c851794ba5b8e814e408",
                    name: "more_games_btn.png"
                }, {
                    bytes: 7053,
                    md5: "c929fc57028f0b1bb413d861ca28374a",
                    name: "pause_btn.png"
                }, {
                    bytes: 16075,
                    md5: "1bc4a1c2e90d889b47d0bea1321229dd",
                    name: "play_btn.png"
                }, {
                    bytes: 18628,
                    md5: "82ea35a3e6ec47a7f1740f1f638275d5",
                    name: "play_btn2.png"
                }, {
                    bytes: 6842,
                    md5: "f8b6287539af7a7abe4eb11803719084",
                    name: "push_btn.png"
                }, {
                    bytes: 9697,
                    md5: "91d0633c4f043325fae748498552ab86",
                    name: "replay_btn.png"
                }, {
                    bytes: 3952,
                    md5: "b67ae29b785df46cf13d8ecb79aa3746",
                    name: "score_icon.png"
                }, {
                    bytes: 1080,
                    md5: "9146bf64a550cde8e5c3ffbbf9b166b0",
                    name: "settings.ini"
                }, {
                    bytes: 10099,
                    md5: "ccbdb366a4a1d214734876d7934f8fab",
                    name: "sound_off_btn.png"
                }, {
                    bytes: 10113,
                    md5: "9c93a1f795e9f1bec94965a30dd6b55e",
                    name: "sound_on_btn.png"
                }, {
                    bytes: 42607,
                    md5: "8838c81c555ad42e3c30bfe8797d5bf7",
                    name: "sounds/bonus_sfx.mp3"
                }, {
                    bytes: 10424,
                    md5: "d35c0c39b450c2575a922c28fc33c923",
                    name: "sounds/button_click_sfx.mp3"
                }, {
                    bytes: 93313,
                    md5: "85490ab22a6b600583168ed59463b5d2",
                    name: "sounds/game_over_sfx.mp3"
                }, {
                    bytes: 29315,
                    md5: "1af5b8cc417d13f5efc9267165ad1fd1",
                    name: "sounds/level_end_sfx.mp3"
                }, {
                    bytes: 19634,
                    md5: "13081b78276534b591339fc0f887f90c",
                    name: "sounds/no_match_sfx.mp3"
                }, {
                    bytes: 9429,
                    md5: "7d7ed72d166f75911d4edc5ec9766ca3",
                    name: "sounds/pop_sfx.mp3"
                }, {
                    bytes: 1387720,
                    md5: "600fa62ca5b385279da7df623e5aaac9",
                    name: "sounds/soundtrack1.mp3"
                }, {
                    bytes: 7385,
                    md5: "ffef02e5ec7ddfa4b54204b97096ad94",
                    name: "spikes_block.png"
                },{
                	bytes: "",
                    md5: "",
                    name: "fail1.png"
                },{
                	bytes: "",
                    md5: "",
                    name: "success.png"
                },{
                	bytes: "",
                    md5: "",
                    name: "success1.png"
                },{
                	bytes: "",
                    md5: "",
                    name: "prize.png"
                },{
                	bytes: "",
                    md5: "",
                    name: "noPrize.png"
                },{
                	bytes: "",
                    md5: "",
                    name: "close.png"
                }],
                boot: [{
                    bytes: 12539,
                    md5: "016399988d42dda354d0e08409adc386",
                     name: "rot_phone.png"
                }]
            }]
        }
    };
    T._supportsCrossOrigin = function () {
        var a;
        a = 0 <= window.navigator.userAgent.indexOf("Linux; U; Android") ? !1 : null != (new XMLHttpRequest).withCredentials;
        a || null;
        return a
    }();
    r._scratchPoint = new la;
    Ca.NEWLINE = new gb(10);
    V._sharedEvent = new Mb;
    K._sharedEvent = new Nb;
    Aa.CANVAS_TEXTURES = (new X("(iPhone|iPod|iPad)", "")).match(window.navigator.userAgent);
    w._mediaRefCount = 0;
    w._detectBlobSupport = !0;
    n.VENDOR_PREFIXES = ["webkit", "moz", "ms", "o", "khtml"];
    n.SHOULD_HIDE_MOBILE_BROWSER = window.top == window && (new X("Mobile(/.*)? Safari", "")).match(window.navigator.userAgent);
    u._detectSupport = !0;
    ia.USE_CACHE = !1;
    ia.USE_ENUM_INDEX = !1;
    ia.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
    P.DEFAULT_RESOLVER = F;
    P.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
    xa.count = 0;
    t.cLevel = 1;
    o.soundsFolder = "sounds";
    o.isMuted = !1;
    e.defaultOrientation = ea.Portrait;
    e.defaultFont = "default_font1";
    e.systemBgColor = 0;
    e.buttonClickSfx = "";
    sa.main()
})();